diff options
| author | grischka <grischka> | 2014-01-06 19:56:26 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2014-01-06 19:56:26 +0100 |
| commit | 2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb (patch) | |
| tree | e556d3d04da0db0d13a58905875537c09302c163 /tccgen.c | |
| parent | d443644de360f68a84c05ab23f20f013b6e05b58 (diff) | |
| download | tinycc-2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb.tar.gz tinycc-2bd0daabbe1fc40e65e4a4631e68f5ca093ea1fb.tar.bz2 | |
misc. fixes
- tccgen: error out for cast to void, as in
void foo(void) { return 1; }
This avoids an assertion failure in x86_64-gen.c, also.
also fix tests2/03_struct.c accordingly
- Error: "memory full" - be more specific
- Makefiles: remove circular dependencies, lookup tcctest.c from VPATH
- tcc.h: cleanup lib, include, crt and libgcc search paths"
avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR
(as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068)
- tcc.h: remove ";{B}" from PE search path
in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote:
"... I'm not sure this is the right way to fix this problem."
And the answer is: No, please. (copying libtcc1.a for tests instead)
- win32/build_tcc.bat: do not move away a versioned file
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -309,7 +309,7 @@ static void vsetc(CType *type, int r, CValue *vc) int v; if (vtop >= vstack + (VSTACK_SIZE - 1)) - tcc_error("memory full"); + tcc_error("memory full (vstack)"); /* cannot let cpu flags if other instruction are generated. Also avoid leaving VT_JMP anywhere except on the top of the stack because it would complicate the code generator. */ @@ -483,7 +483,7 @@ ST_FUNC void vswap(void) ST_FUNC void vpushv(SValue *v) { if (vtop >= vstack + (VSTACK_SIZE - 1)) - tcc_error("memory full"); + tcc_error("memory full (vstack)"); vtop++; *vtop = *v; } @@ -2348,8 +2348,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 (sbt == VT_VOID || dbt == VT_VOID) + tcc_error("cannot cast from/to void"); if (dt->t & VT_CONSTANT) tcc_warning("assignment of read-only location"); switch(dbt) { |
