Skip to content

Commit

Permalink
Fix <= 3.1.46
Browse files Browse the repository at this point in the history
  • Loading branch information
jerbob92 committed Dec 1, 2023
1 parent d2d4689 commit ec9b908
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/emval.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ var EmvalRunDestructors = api.GoModuleFunc(func(ctx context.Context, mod api.Mod
engine := MustGetEngineFromContext(ctx, mod).(*engine)
id := api.DecodeI32(stack[0])

// Fix emval_run_destructors for <= 3.1.46 when id is 0 (no destructors).
if id == 0 {
return
}

destructorsVal, err := engine.emvalEngine.toValue(id)
if err != nil {
panic(fmt.Errorf("could not find handle: %w", err))
Expand Down

0 comments on commit ec9b908

Please sign in to comment.