diff options
author | Ofek Shilon <ofekshilon@gmail.com> | 2024-02-10 09:19:56 +0200 |
---|---|---|
committer | Ofek Shilon <ofekshilon@gmail.com> | 2024-02-10 09:22:42 +0200 |
commit | d8fba38400612099a1da614a3774d3e75bd3a052 (patch) | |
tree | d620d65cf0b36002b661351e6beb3e5141245231 /lib/compilers/java.ts | |
parent | 4605ebfb4bcf7997ba57aa86b879a7d781327238 (diff) | |
download | compiler-explorer-d8fba38400612099a1da614a3774d3e75bd3a052.tar.gz compiler-explorer-d8fba38400612099a1da614a3774d3e75bd3a052.zip |
Fix #6091: Add consideration for negative prefix matchesgh-10555
Diffstat (limited to 'lib/compilers/java.ts')
-rw-r--r-- | lib/compilers/java.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/compilers/java.ts b/lib/compilers/java.ts index a2e027751..8fea06be2 100644 --- a/lib/compilers/java.ts +++ b/lib/compilers/java.ts @@ -304,8 +304,11 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo for (const codeLineCandidate of utils.splitLines(codeAndLineNumberTable)) { // Match // 1: invokespecial #1 // Method java/lang/Object."<init>":()V - // Or match the "default: <code>" block inside a lookupswitch instruction - const match = codeLineCandidate.match(/\s+(\d+|default): (.*)/); + // Or match lines inside inside a lookupswitch instruction like: + // 8: <code> + // -1: <code> + // default: <code> + const match = codeLineCandidate.match(/\s+([-\d]+|default): (.*)/); if (match) { const instrOffset = Number.parseInt(match[1]); method.instructions.push({ |