Commit 1ea29920 authored by Chris Ramstad's avatar Chris Ramstad

XOR returned value from id function by constant

parent b8994b25
...@@ -181,7 +181,7 @@ extern "C" Box* sum(Box* container, Box* initial) { ...@@ -181,7 +181,7 @@ extern "C" Box* sum(Box* container, Box* initial) {
} }
extern "C" Box* id(Box* arg) { extern "C" Box* id(Box* arg) {
i64 addr = (i64)(arg); i64 addr = (i64)(arg) ^ 0xdeadbeef00000003;
return boxInt(addr); return boxInt(addr);
} }
......
...@@ -2,7 +2,8 @@ x = 'Hi' ...@@ -2,7 +2,8 @@ x = 'Hi'
y = 1 y = 1
z = (42, 7) z = (42, 7)
f = (2,) + z f = (2,) + z
id(x) print id(x) == id(x)
id(y) print id(y) != id(x)
id(z) print id(z) == id(z)
id(f) print id(f) != id(z)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment