Re: [C--] Segmentation fault

John Dias <[email protected]> Tue, 24 Mar 2009 11:17:12 -0400 (EDT)
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
> This is bad. Anyway, the c-- code seems correct, but the executable code

The call to strcmp passes the wrong value for the first argument:

          _fooret = foreign "C" strcmp (bits32[a_T_155], str__a_da_289565476_1);

The first argument here is not the address of the string: it is the result 
of loading 32 bits from the address of the string. You want:

          _fooret = foreign "C" strcmp (a_T_155, str__a_da_289565476_1);

Cheers,
-j

_______________________________________________
Cminusminus mailing list
[email protected]
https://www.eecs.harvard.edu/mailman/listinfo/cminusminus