Skip to content

Conversation

@thevilledev
Copy link
Contributor

@thevilledev thevilledev commented Nov 30, 2025

Previously, safe builtin functions (OpCallSafe) were pushed to the stack as constants (OpPush), causing the disassembler/debugger to display their memory address (e.g., 0x140000...) instead of their name (e.g., concat). This change updates the compiler to store the function name in debugInfo when emitting OpCallSafe.

Output from repl:

❯ concat(1..2, 3..4)
[1 2 3 4]
❯ opcodes
0  OpPush  <0>  1
1  OpPush  <1>  2
2  OpRange
3  OpPush  <2>  3
4  OpPush  <3>  4
5  OpRange
6  OpPush      <4>  concat
7  OpCallSafe  <2>

Fixes #567.

Previously, safe builtin functions (OpCallSafe) were pushed to the stack
as constants (OpPush), causing the disassembler/debugger to display
their memory address (e.g., 0x140000...) instead of their name (e.g.,
concat).

This change updates the compiler to store the function name in debugInfo
when emitting OpCallSafe. The VM's disassembler now checks debugInfo for
OpPush arguments and displays the stored name if available.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix debugger to show correct name for concat()

1 participant