aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-11-17 14:09:18 +0100
committerAyke van Laethem <[email protected]>2018-11-17 14:09:18 +0100
commit4fdffdf8b26db281209679ec73040a8c6d6cf915 (patch)
treeabeaacef5af85d23dc77cae7f01f5516c348c6fe
parentc3c4a33b4275b6fa28ee79fe6caf2aaaac73c719 (diff)
downloadtinygo-4fdffdf8b26db281209679ec73040a8c6d6cf915.tar.gz
tinygo-4fdffdf8b26db281209679ec73040a8c6d6cf915.zip
interp: support non-const ptrtoint instruction
-rw-r--r--interp/frame.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/interp/frame.go b/interp/frame.go
index a8d85095a..b3ba843b9 100644
--- a/interp/frame.go
+++ b/interp/frame.go
@@ -160,6 +160,9 @@ func (fr *frame) evalBasicBlock(bb, incoming llvm.BasicBlock, indent string) (re
case !inst.IsAFPExtInst().IsNil():
value := fr.getLocal(inst.Operand(0))
fr.locals[inst] = &LocalValue{fr.Eval, fr.builder.CreateFPExt(value.(*LocalValue).Value(), inst.Type(), "")}
+ case !inst.IsAPtrToIntInst().IsNil():
+ value := fr.getLocal(inst.Operand(0))
+ fr.locals[inst] = &LocalValue{fr.Eval, fr.builder.CreatePtrToInt(value.Value(), inst.Type(), "")}
case !inst.IsABitCastInst().IsNil() && inst.Type().TypeKind() == llvm.PointerTypeKind:
operand := inst.Operand(0)
if !operand.IsACallInst().IsNil() {