Added struct lifetime test

This commit is contained in:
Eduard Urbach 2025-03-10 15:58:31 +01:00
parent 377b66663f
commit f7a4f0cacc
Signed by: eduard
GPG key ID: 49226B848C78F6C8
3 changed files with 12 additions and 0 deletions

View file

@ -39,6 +39,9 @@ func (f *Function) CompileAssign(node *ast.Assign) error {
case *eval.Register:
f.Execute(operation, leftValue.Register, right)
case *eval.Memory:
// TODO: Reservation needs to be canceled on defer
f.CurrentScope().Reserve(leftValue.Memory.Base)
if operation.Kind == token.Assign {
rightValue, err := f.Evaluate(right)