Fixed superfluous Oppop for void ExpressionStatements

This commit is contained in:
Matthias Raba 2024-07-05 09:42:00 +02:00
parent d648e5dd05
commit 2d1309a5fe

View File

@ -252,10 +252,11 @@ assembleStatement (constants, ops, lvars) (TypedStatement _ (LocalVariableDeclar
in
(constants_init, ops_init ++ storeLocal, lvars ++ [name])
assembleStatement (constants, ops, lvars) (TypedStatement _ (StatementExpressionStatement expr)) = let
assembleStatement (constants, ops, lvars) (TypedStatement dtype (StatementExpressionStatement expr)) = let
(constants_e, ops_e, lvars_e) = assembleStatementExpression (constants, ops, lvars) expr
in
(constants_e, ops_e ++ [Oppop], lvars_e)
in case dtype of
"void" -> (constants_e, ops_e, lvars_e)
_ -> (constants_e, ops_e ++ [Oppop], lvars_e)
assembleStatement _ stmt = error ("Unknown statement: " ++ show stmt)