[fpc-devel] Valgrind Val

Florian Klaempfl florian at freepascal.org
Sun Apr 6 21:35:26 CEST 2008


petr.kristan at epos.cz schrieb:
> This program runed in valgrind brings on error:
> 
> program val;
> var
>   n, e: Integer;
> begin
>   System.Val('', n, e);
> end.
> 
> 
> ==18377== Conditional jump or move depends on uninitialised value(s)
> ==18377==    at 0x804EDC5:
> SYSTEM_INITVAL$SHORTSTRING$BOOLEAN$BYTE$$LONGINT (sstrings.inc:768)
> ==18377==    by 0x804EEDA: fpc_val_sint_shortstr (sstrings.inc:819)
> ==18377==    by 0x805171A: fpc_val_sint_ansistr (astrings.inc:881)
> ==18377==    by 0x804827C: main (val.pas:5)
> 
> Problem is that InitVal does not take into account empty string.
> And this little patch solves this for me.

Thanks, applied.



More information about the fpc-devel mailing list