Skip to content

Commit

Permalink
Fix exception in case of empty IR (#6450)
Browse files Browse the repository at this point in the history
This fixes #6449 - I carelessly ignored the case of empty IR output.
Repro link for verification: https://godbolt.org/z/4d46dahqq
  • Loading branch information
OfekShilon committed May 7, 2024
1 parent 98624bb commit c7ce3ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c7ce3ca

Please sign in to comment.