Skip to content

Instantly share code, notes, and snippets.

@hns
Created March 18, 2015 21:42
Show Gist options
  • Save hns/c0c7284a8bb296246df4 to your computer and use it in GitHub Desktop.
Save hns/c0c7284a8bb296246df4 to your computer and use it in GitHub Desktop.
diff -r 524852d0cc0d src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Mon Mar 16 18:13:38 2015 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java Wed Mar 18 22:40:47 2015 +0100
@@ -405,6 +405,7 @@
int endp;
isNull = 1;
while (k < stk) {
+ e = stack[k++];
if (e.type == MEM_START) {
if (e.getMemEnd() == INVALID_INDEX) {
isNull = 0;
@@ -415,15 +416,12 @@
} else {
endp = e.getMemEnd();
}
- if (stack[e.getMemStart()].getMemPStr() != endp) {
- isNull = 0;
+ if (e.getMemPStr() != endp || endp != s) {
+ isNull = 0; /* not empty or position did change */
break;
- } else if (endp != s) {
- isNull = -1; /* empty, but position changed */
}
+ isNull = -1;
}
- k++;
- e = stack[k]; // !!
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment