[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] git rev 3ad64ff breaks tcc
From: |
Roy Tam |
Subject: |
[Tinycc-devel] git rev 3ad64ff breaks tcc |
Date: |
Mon, 18 Feb 2013 08:25:59 +0800 |
Hi all,
tcc rev 3ad64ff segfaults in strlen().
/d/tinycc$ gdb tcc.exe
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from d:\tinycc\tcc.exe...done.
(gdb) r
Starting program: d:\tinycc\tcc.exe
[New Thread 536.0xfb0]
Program received signal SIGSEGV, Segmentation fault.
0x77c178ac in strlen () from C:\WINDOWS\system32\msvcrt.dll
(gdb) bt
#0 0x77c178ac in strlen () from C:\WINDOWS\system32\msvcrt.dll
#1 0x00402f0f in tcc_define_symbol (address@hidden,
address@hidden "__STDC_HOSTED__",
address@hidden <Address 0x1 out of bounds>) at libtcc.c:829
#2 0x00403c5e in tcc_new () at libtcc.c:927
#3 0x004257c6 in main (argc=1, argv=0x3e3fc0) at tcc.c:251
Patch:
diff --git a/libtcc.c b/libtcc.c
index c500e45..1fdee49 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -924,7 +924,7 @@ LIBTCCAPI TCCState *tcc_new(void)
/* standard defines */
tcc_define_symbol(s, "__STDC__", NULL);
tcc_define_symbol(s, "__STDC_VERSION__", "199901L");
- tcc_define_symbol(s, "__STDC_HOSTED__", 1);
+ tcc_define_symbol(s, "__STDC_HOSTED__", "1");
/* target defines */
#if defined(TCC_TARGET_I386)
- [Tinycc-devel] git rev 3ad64ff breaks tcc,
Roy Tam <=