-
Notifications
You must be signed in to change notification settings - Fork 14
ZJIT: Local variable clobbered on --zjit-disable-hir-opt #970
Copy link
Copy link
Open
Description
The following test (reduced from ruby-spec) fails:
# ./miniruby --zjit-call-threshold=1 --zjit-disable-hir-opt test.rb
def test
ofor = nil
n = 0
eval("n = 2")
raise unless ofor.nil? # commenting out this line dodges the bug
raise "n=#{n} and !=2" unless n == 2
end
test
testThe ofor.nil? call causes a local variable spill, clobbering the n assigned in eval.
Some ways to fix this:
- Reload all local variables after each
Send, like we already do forSendwith a block. - Put a
PatchPoint NoEpEscapeafter each send - Reason about what value each local variable could hold in an optimization pass instead of during HIR build, loading/storing through EP like the interpreter as a baseline (Though, this might fix the symptom but not the root cause.)
We want to have a discussion before picking an option.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.