aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp
diff options
context:
space:
mode:
Diffstat (limited to 'interp')
-rw-r--r--interp/interpreter.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/interp/interpreter.go b/interp/interpreter.go
index 605f4d8fc..e0074ba26 100644
--- a/interp/interpreter.go
+++ b/interp/interpreter.go
@@ -427,6 +427,10 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
if err != nil {
return nil, mem, r.errorAt(inst, err)
}
+ if typecodePtr.offset() == 0 {
+ locals[inst.localIndex] = literalValue{uint8(0)}
+ break
+ }
typecodePtrOffset, err := typecodePtr.addOffset(-int64(r.pointerSize))
if err != nil {
return nil, mem, r.errorAt(inst, err) // unlikely