Skip to content
Snippets Groups Projects
Commit ae5a8d29 authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix: Race when using lookup result.

parent c4faee90
No related branches found
No related tags found
No related merge requests found
...@@ -619,18 +619,17 @@ public final class ReadVariableNode extends RBaseNode { ...@@ -619,18 +619,17 @@ public final class ReadVariableNode extends RBaseNode {
LookupResult lookup = FrameSlotChangeMonitor.lookup(variableFrame, identifier); LookupResult lookup = FrameSlotChangeMonitor.lookup(variableFrame, identifier);
if (lookup != null) { if (lookup != null) {
try { try {
if (lookup.getValue() instanceof RPromise) { Object value = lookup.getValue();
evalPromiseSlowPathWithName(identifierAsString, frame, (RPromise) lookup.getValue()); if (value instanceof RPromise) {
evalPromiseSlowPathWithName(identifierAsString, frame, (RPromise) value);
} }
if (lookup != null) { if (lookup instanceof FrameAndSlotLookupResult) {
if (lookup instanceof FrameAndSlotLookupResult) { if (checkTypeSlowPath(frame, value)) {
if (checkTypeSlowPath(frame, lookup.getValue())) { return new FrameAndSlotLookupLevel((FrameAndSlotLookupResult) lookup);
return new FrameAndSlotLookupLevel((FrameAndSlotLookupResult) lookup); }
} } else {
} else { if (value == null || checkTypeSlowPath(frame, value)) {
if (lookup.getValue() == null || checkTypeSlowPath(frame, lookup.getValue())) { return new LookupLevel(lookup);
return new LookupLevel(lookup);
}
} }
} }
} catch (InvalidAssumptionException e) { } catch (InvalidAssumptionException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment