diff --git a/src/ircode.c b/src/ircode.c index 196f9f7b413ad..2e16d1b5b2420 100644 --- a/src/ircode.c +++ b/src/ircode.c @@ -1234,7 +1234,6 @@ JL_DLLEXPORT jl_string_t *jl_compress_codelocs(int32_t firstline, jl_value_t *co #undef SETMIN #undef SETMAX } - min.line = min.to = min.pc = firstline <= 0 ? INT32_MAX : firstline; int32_t header[3]; header[0] = min.line > max.line ? 0 : min.line; header[1] = min.line > max.line ? 0 : max.line - min.line; diff --git a/test/compiler/ssair.jl b/test/compiler/ssair.jl index 9d5f7b617080d..9ff4d3d8a4220 100644 --- a/test/compiler/ssair.jl +++ b/test/compiler/ssair.jl @@ -825,3 +825,10 @@ end @test_throws ErrorException f_must_throw_phinode_edge() global global_error_switch = false @test f_must_throw_phinode_edge() == 1 + +# Test roundtrip of debuginfo compression +let cl = Int32[32, 1, 1, 1000, 240, 230] + str = ccall(:jl_compress_codelocs, Any, (Int32, Any, Int), 378, cl, 2)::String; + cl2 = ccall(:jl_uncompress_codelocs, Any, (Any, Int), str, 2) + @test cl == cl2 +end