Skip to content

Commit 32828a0

Browse files
committed
fix(vm): self referencing values can be printed as such
1 parent 9f9c724 commit 32828a0

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/std

Submodule std updated 1 file

src/arkreactor/VM/Value.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ namespace Ark
114114
return "undefined";
115115

116116
case ValueType::Reference:
117-
return reference()->toString(vm);
117+
if (reference() != this)
118+
return reference()->toString(vm);
119+
return "Ref(self)";
118120

119121
case ValueType::InstPtr:
120122
return fmt::format("Instruction @ {}", pageAddr());

0 commit comments

Comments
 (0)