mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Mark block expr result as rvalue when used as one
At least for return. There may be other cases that need it, but this fixes comma-expr.r (minus int->float promotion issues).
This commit is contained in:
parent
d9c9686288
commit
e849c2d1ce
3 changed files with 5 additions and 2 deletions
|
@ -2021,6 +2021,9 @@ return_expr (function_t *f, expr_t *e)
|
|||
if (e->type == ex_vector) {
|
||||
e = assign_expr (new_temp_def_expr (t), e);
|
||||
}
|
||||
if (e->type == ex_block) {
|
||||
e->e.block.result->rvalue = 1;
|
||||
}
|
||||
return new_unary_expr ('r', e);
|
||||
}
|
||||
|
||||
|
|
|
@ -1351,7 +1351,7 @@ cexpr
|
|||
{
|
||||
if ($1->next) {
|
||||
expr_t *res = $1;
|
||||
$1 = build_block_expr ($1->next);
|
||||
$1 = build_block_expr ($1);
|
||||
$1->e.block.result = res;
|
||||
}
|
||||
$$ = $1;
|
||||
|
|
|
@ -1273,7 +1273,7 @@ statement_uexpr (sblock_t *sblock, expr_t *e)
|
|||
static sblock_t *
|
||||
statement_nonexec (sblock_t *sblock, expr_t *e)
|
||||
{
|
||||
if (options.warnings.executable)
|
||||
if (!e->rvalue && options.warnings.executable)
|
||||
warning (e, "Non-executable statement; executing programmer instead.");
|
||||
return sblock;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue