about summary refs log tree commit diff
path: root/pkg/lang/vm/mem/ptr.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-05-27 23:34:40 +0000
committerGitHub <noreply@github.com>2022-05-27 23:34:40 +0000
commit83d1dc87f3336d70ccda476627c70c282b7b6e11 (patch)
tree70610879d3de1ddf02bbe9067076fe65b52979a9 /pkg/lang/vm/mem/ptr.go
parent47c4cd3705bee9d7154c42ce95aef6f8a19e0661 (diff)
downloadjinx-83d1dc87f3336d70ccda476627c70c282b7b6e11.tar.zst
jinx-83d1dc87f3336d70ccda476627c70c282b7b6e11.zip
Function envs and value escaping
Diffstat (limited to 'pkg/lang/vm/mem/ptr.go')
-rw-r--r--pkg/lang/vm/mem/ptr.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/lang/vm/mem/ptr.go b/pkg/lang/vm/mem/ptr.go
index 5e3bf3d..f6e3e64 100644
--- a/pkg/lang/vm/mem/ptr.go
+++ b/pkg/lang/vm/mem/ptr.go
@@ -4,7 +4,15 @@ import "strconv"
 
 type Ptr uint64
 
+const (
+	NullPtr Ptr = 0
+)
+
 func (p Ptr) String() string {
 	val := strconv.FormatUint(uint64(p), 10)
 	return "@" + val
 }
+
+func (p Ptr) IsNull() bool {
+	return p == NullPtr
+}