mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 00:22:36 +02:00
The compile() function was adding source map entries for all instructions in a block upfront, before processing assembly-time optimizations (Jump-to-next-block elision, Jump-to-Return/End inlining, JumpIf-to-JumpTrue/JumpFalse conversion). When a Jump was skipped, its phantom source map entry remained at the offset where the next block's first instruction would be placed, causing binary_search to find the wrong source location for error messages. Fix by building source map entries inline with instruction emission, ensuring only actually-emitted instructions get entries. For blocks with duplicate source map entries at the same offset (from rewind in fuse_compare_and_jump), the last entry is used.
83 KiB
83 KiB