diff options
| author | Shinichiro Hamaji <shinichiro.hamaji _at_ gmail.com> | 2009-04-16 02:34:59 +0900 |
|---|---|---|
| committer | grischka <grischka> | 2009-04-18 15:08:01 +0200 |
| commit | 83fd36333a691050663a15c07b385bdf554bf01d (patch) | |
| tree | 062bf6d4eb06e488b05439ca2040a178b15d3a27 /tcc.c | |
| parent | be43c8e0ed22faa6c89c6e551f2a07512673d60d (diff) | |
| download | tinycc-83fd36333a691050663a15c07b385bdf554bf01d.tar.gz tinycc-83fd36333a691050663a15c07b385bdf554bf01d.tar.bz2 | |
Fixes for issues I've just found/introduced to x86 TCC.
- Cast from pointer to long long makes TCC output an error. Use cast to int before we apply shift operation for a pointer value.
- Removed test cases for casts from pointer to char/short because they produce warning.
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -6219,6 +6219,11 @@ static void gen_cast(CType *type) vpushi(0); gv(RC_INT); } else { + if (sbt == VT_PTR) { + /* cast from pointer to int before we apply + shift operation, which pointers don't support*/ + gen_cast(&int_type); + } gv_dup(); vpushi(31); gen_op(TOK_SAR); |
