Access violation when empty command-line parameter used
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
When you accidentally use an empty command-line parameter, that is pass an empty string, like
$ fpc ''
inside bash shell, then FPC fails with Access Violation without any helpful error message:
$ fpc ''
Fatal: Compilation aborted
An unhandled exception occurred at $080EF1E8 :
EAccessViolation : Access violation<br/>
$080EF1E8
$080F03B0
$08066602
Error: /home/michal/installed/fpc/2.6.0/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
While never documented, FPC 2.4.4 and FPC 2.6.0-rc1 were silently ignoring such empty parameter. I found out about this bug, because my compilation scripts accidentally depended on this behavior, using
fpc "$BLAH" ....
and depending that nothing bad happens when BLAH is empty or undefined. Suddenly compilation with FPC 2.6.0 fails always with segfault. Of course, this is entirely my error and I shouldn't use such empty parameter. But probably compiler should answer with a clear error message instead of a segfault :)
Mantis conversion info:
- Mantis ID: 21000
- OS: Debian GNU/Linux
- OS Build: (testing)
- Platform: i386
- Fixed in version: 3.0.0
- Fixed in revision: 19394 (#cf7b4394)