mirror of
https://github.com/frida/tinycc
synced 2024-11-24 08:39:37 +03:00
Error out when assigning void value.
tcc should now error out when compiling code like: VOID ExitProcess(UINT uExitCode); (…) retCode = ExitProcess(pi.dwProcessId);
This commit is contained in:
parent
9c25ed13b4
commit
3ab269c56a
2
tccgen.c
2
tccgen.c
@ -2258,6 +2258,8 @@ static void gen_assign_cast(CType *dt)
|
||||
st = &vtop->type; /* source type */
|
||||
dbt = dt->t & VT_BTYPE;
|
||||
sbt = st->t & VT_BTYPE;
|
||||
if (sbt == VT_VOID)
|
||||
tcc_error("Cannot assign void value");
|
||||
if (dt->t & VT_CONSTANT)
|
||||
tcc_warning("assignment of read-only location");
|
||||
switch(dbt) {
|
||||
|
Loading…
Reference in New Issue
Block a user