From 614790dc14b4a1b2055d040d290abcb60e05ef59 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Tue, 15 Dec 2009 17:45:15 +0100 Subject: [PATCH] x86-64: Fix Wrong comparisonbetweenpointerandlongcste main (int argc, char *argv[]) { char *p = (char *)0x12345678ABCD000F; int res; res = (p != (char *)0x12345678ABCD000F); return res; } --- tccgen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tccgen.c b/tccgen.c index 58d0d89..2a03fb6 100644 --- a/tccgen.c +++ b/tccgen.c @@ -1543,6 +1543,10 @@ static void gen_cast(CType *type) vtop->c.ll = vtop->c.ull; else if (sbt & VT_UNSIGNED) vtop->c.ll = vtop->c.ui; +#ifdef TCC_TARGET_X86_64 + else if (sbt == VT_PTR) + ; +#endif else if (sbt != VT_LLONG) vtop->c.ll = vtop->c.i;