aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccgen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccgen.c b/tccgen.c
index dc67f02..3cf3715 100644
--- a/tccgen.c
+++ b/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) {