diff options
Diffstat (limited to 'lib/compilers/java.js')
-rw-r--r-- | lib/compilers/java.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/compilers/java.js b/lib/compilers/java.js index b321fffe1..383f56013 100644 --- a/lib/compilers/java.js +++ b/lib/compilers/java.js @@ -81,10 +81,10 @@ export class JavaCompiler extends BaseCompiler { asm: objResult.stdout, }; - if (objResult.code !== 0) { - oneResult.asm = '<No output: javap returned ' + objResult.code + '>'; - } else { + if (objResult.code === 0) { oneResult.objdumpTime = objResult.execTime; + } else { + oneResult.asm = '<No output: javap returned ' + objResult.code + '>'; } return oneResult; }), @@ -328,11 +328,11 @@ export class JavaCompiler extends BaseCompiler { currentInstr < method.instructions.length && method.instructions[currentInstr].instrOffset !== instrOffset ) { - if (currentSourceLine !== -1) { + if (currentSourceLine === -1) { + logger.error('Skipping over instruction even though currentSourceLine == -1'); + } else { // instructions without explicit line number get assigned the last explicit/same line number method.instructions[currentInstr].sourceLine = currentSourceLine; - } else { - logger.error('Skipping over instruction even though currentSourceLine == -1'); } currentInstr++; } @@ -343,7 +343,7 @@ export class JavaCompiler extends BaseCompiler { method.instructions[currentInstr].sourceLine = currentSourceLine; } - if (typeof method.startLine === 'undefined') { + if (method.startLine === undefined) { method.startLine = sourceLine; } // method.instructions.push({sourceLine: instrOffset}); |