@@ -279,15 +279,21 @@ end
279279 ccall (:jl_set_inference_entrance_backtraces , Cvoid, (Any,), nothing )
280280 ln = @__LINE__ () - 2
281281 fl = Symbol (@__FILE__ ())
282- @test length (dispatch_backtraces) == 2
282+ @test length (dispatch_backtraces) == 4 # 2 ci-backtrace pairs, stored as 4 separate elements
283283 mcallee, mcaller = only (methods (callee)), only (methods (caller))
284- @test any (dispatch_backtraces) do (ci, trace)
285- ci. def. def === mcallee && any (stacktrace (trace)) do sf
284+ # Extract pairs from the flattened array format: ci at odd indices, backtrace at even indices
285+ pairs = [(dispatch_backtraces[i], dispatch_backtraces[i+ 1 ]) for i in 1 : 2 : length (dispatch_backtraces)]
286+ @test any (pairs) do (ci, trace)
287+ # trace is a SimpleVector from jl_backtrace_from_here, need to reformat before stacktrace
288+ bt = Base. _reformat_bt (trace[1 ], trace[2 ])
289+ ci. def. def === mcallee && any (stacktrace (bt)) do sf
286290 sf. file == fl && sf. line == ln
287291 end
288292 end
289- @test any (dispatch_backtraces) do (ci, trace)
290- ci. def. def === mcaller && any (stacktrace (trace)) do sf
293+ @test any (pairs) do (ci, trace)
294+ # trace is a SimpleVector from jl_backtrace_from_here, need to reformat before stacktrace
295+ bt = Base. _reformat_bt (trace[1 ], trace[2 ])
296+ ci. def. def === mcaller && any (stacktrace (bt)) do sf
291297 sf. file == fl && sf. line == ln
292298 end
293299 end
0 commit comments