commit 2cad94c36488366e50eaacc2fd669760a1b9020a
parent 3bd20aeaac4b12cf60bfa3abae0e1036fa699a91
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 11 Jan 2023 11:56:23 +0100
cc1: Simplify expressions in Return
The change in 19ae8097 made that expressions in return statements
are not simplified.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/cc/cc1/stmt.c b/src/cmd/cc/cc1/stmt.c
@@ -178,7 +178,7 @@ Return(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
expect(RETURN);
if (yytoken != ';')
- np = decay(expr());
+ np = simplify(decay(expr()));
expect(';');
if (!np && tp != voidtype)