diff options
author | Ofek <ofekshilon@gmail.com> | 2024-05-07 20:49:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 20:49:27 +0300 |
commit | c7ce3ca07103d27ac0bb46617737ce1dd7128e3b (patch) | |
tree | 68f88b24ca1293b88ea16319dc21fcaf67925a46 | |
parent | 98624bbb96b91c4815705f5343944cb46c0f7ead (diff) | |
download | compiler-explorer-c7ce3ca07103d27ac0bb46617737ce1dd7128e3b.tar.gz compiler-explorer-c7ce3ca07103d27ac0bb46617737ce1dd7128e3b.zip |
Fix exception in case of empty IR (#6450)gh-11668
This fixes #6449 - I carelessly ignored the case of empty IR output.
Repro link for verification: https://godbolt.org/z/4d46dahqq
-rw-r--r-- | lib/base-compiler.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 942a49ce0..60d05d969 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -1444,7 +1444,7 @@ export class BaseCompiler implements ICompiler { asm: ir.asm, }; - if (result.asm[result.asm.length - 1].text === '[truncated; too many lines]') { + if (result.asm.length > 0 && result.asm[result.asm.length - 1].text === '[truncated; too many lines]') { return result; } |