mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-01 16:51:12 +00:00
Fixed problem where functions without body produced an empty block.
This commit is contained in:
parent
f2314caadb
commit
0f7c6733f7
@ -31,6 +31,9 @@ public class Pass1GenerateControlFlowGraph extends Pass1Base {
|
|||||||
for(Procedure procedure : allProcedures) {
|
for(Procedure procedure : allProcedures) {
|
||||||
final ProcedureCompilation procedureCompilation = getProgram().getProcedureCompilation(procedure.getRef());
|
final ProcedureCompilation procedureCompilation = getProgram().getProcedureCompilation(procedure.getRef());
|
||||||
final StatementSequence sequence = procedureCompilation.getStatementSequence();
|
final StatementSequence sequence = procedureCompilation.getStatementSequence();
|
||||||
|
if(sequence.getStatements().size()==0)
|
||||||
|
// Empry procedures should not produce any blocks
|
||||||
|
continue;
|
||||||
ControlFlowBlock currentBlock = null;
|
ControlFlowBlock currentBlock = null;
|
||||||
ControlFlowBlock procBlock = getOrCreateBlock(procedure.getLabel().getRef(), procedure.getRef());
|
ControlFlowBlock procBlock = getOrCreateBlock(procedure.getLabel().getRef(), procedure.getRef());
|
||||||
currentBlock = procBlock;
|
currentBlock = procBlock;
|
||||||
|
Loading…
Reference in New Issue
Block a user