Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a24037f7bd59
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1de3ef2f724f
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Aug 16, 2016

  1. Copy the full SHA
    498acef View commit details
  2. Copy the full SHA
    1de3ef2 View commit details
Showing with 7 additions and 12 deletions.
  1. +7 −12 truffle/src/main/java/org/jruby/truffle/core/regexp/RegexpNodes.java
Original file line number Diff line number Diff line change
@@ -513,7 +513,7 @@ public Object lastMatch(VirtualFrame frame, int index,

@TruffleBoundary
private Object getMatchData() {
Frame frame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameInstance.FrameAccess.READ_WRITE, true);
Frame frame = getContext().getCallStack().getCallerFrameIgnoringSend().getFrame(FrameAccess.READ_ONLY, true);
FrameSlot slot = frame.getFrameDescriptor().findFrameSlot("$~");

while (slot == null) {
@@ -527,19 +527,14 @@ private Object getMatchData() {
}
}

final Object previousMatchData;
try {
previousMatchData = frame.getObject(slot);
final Object previousMatchData = frame.getValue(slot);

if (previousMatchData instanceof ThreadLocalObject) {
final ThreadLocalObject threadLocalObject = (ThreadLocalObject) previousMatchData;
if (previousMatchData instanceof ThreadLocalObject) {
final ThreadLocalObject threadLocalObject = (ThreadLocalObject) previousMatchData;

return threadLocalObject.get();
} else {
return previousMatchData;
}
} catch (FrameSlotTypeException e) {
throw new IllegalStateException(e);
return threadLocalObject.get();
} else {
return previousMatchData;
}
}