Closed brachetti closed 8 months ago
I found the problem, sorry for bothering 🥲
FWIW, I mistyped a sizeof calculation in the ALLOCATE(type, count)
macro (true
instead of type
), here's the fix
I only found the issue due to a hint in CLion actually, saying there's something fishy going on in a sizeof check
At the end of chapter 20, we store strings in the vm's internal hash table. This works great, except when we want to concatenate multiple new strings in one line, which leads to a segmentation fault. As far as I can tell that is due to the last string not having been committed to the table before.
So this code leads to an error state:
This is the output from Lox with debug information
For reference, this is my current working state
Disclaimer: There's a decent chance that I made a mistake, in which case I would be grateful for pointers. I already spent an ungodly amount of time on this 💯