File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2839,8 +2839,13 @@ void StackIRToBinaryWriter::write() {
28392839 WASM_UNREACHABLE (" unexpected op" );
28402840 }
28412841 }
2842+ // Indicate the debug location corresponding to the end opcode that
2843+ // terminates the function code.
28422844 if (func->epilogLocation .size ()) {
28432845 parent.writeDebugLocation (*func->epilogLocation .begin ());
2846+ } else {
2847+ // The end opcode has no debug location.
2848+ parent.writeNoDebugLocation ();
28442849 }
28452850 writer.emitFunctionEnd ();
28462851}
Original file line number Diff line number Diff line change 22;; RUN: echo >> %t.wasm.map
33;; RUN: cat %t.wasm.map | filecheck %s
44
5+ ;; Also test with StackIR, which should have identical results.
6+ ;;
7+ ;; RUN: wasm-opt %s --generate-stack-ir -o %t.wasm -osm %t.map -g -q
8+ ;; RUN: echo >> %t.wasm.map
9+ ;; RUN: cat %t.wasm.map | filecheck %s
10+
511;; Check that the debug locations do not smear beyond a function
612;; epilogue to the next function. The encoded segment 'C' means that
713;; the previous segment is indeed one-byte long.
Original file line number Diff line number Diff line change 33;; RUN: wasm-opt %s -g -o %t.wasm -osm %t.wasm.map
44;; RUN: wasm-opt %t.wasm -ism %t.wasm.map -S -o - | filecheck %s
55
6+ ;; Also test with StackIR, which should have identical results.
7+ ;;
8+ ;; RUN: wasm-opt %s --generate-stack-ir -o %t.wasm -osm %t.map -g -q
9+ ;; RUN: wasm-opt %t.wasm -ism %t.map -q -o - -S | filecheck %s
10+
611;; Verify that writing to a source map and reading it back does not "smear"
712;; debug info across adjacent instructions. The debug info in the output should
813;; be identical to the input.
You can’t perform that action at this time.
0 commit comments