[ragel-users] BUG while processing import directive

Denis Naumov alexander.me at gmail.com
Mon Jul 11 14:25:42 UTC 2011


Josef,

it's ok :)

this bug is not critical. But it is in original source code.
Just look at void Scanner::handleImport() function in rlscan.rl

and this bug will cause in all versions for all platforms (i think).
as yout can see in souce code in handleImport() function.

== souce code == handleImport() =========================
                ifstream *inFile = tryOpenInclude( importChecks, found );
                if ( inFile == 0 )
                                    {
                        scan_error() << "import: could not open import file " <<
                                        "for reading" << endl;
                        char **tried = importChecks;
                        while ( *tried != 0 )
                                scan_error() << "import: attempted:
\"" << *tried++ << '\"' << endl;
                }

                Scanner scanner( id, importChecks[found], *inFile, parser, 0,
includeDepth+1, true );
                scanner.do_scan( );
                scanner.importToken( 0, 0, 0 );
                scanner.flushImport();
                delete inFile;

========================

Scanner will run always. even if " if ( inFile == 0 ) "

I think Adrian can fix this in original source code.


Best regards.
Denis.


2011/7/11  <ragel-user at jgoettgens.de>:
> I am currently running the debug version unter VS. The original source code
> does not contain all the _MSVC related patches, so I have to add them by
> hand for every new release && this time I have forgotten to add a patch in
> (at least) 2 places. I have not used the "import" statement myself so far,
> but unfortunately the "include" statement is affected as well. After I'll
> have finished my basic tests I'll publish a fresh version in about 30
> minutes, or so.
>
> It looks as if there is more than the Windows path handling since invalid
> names of imported files do not seem to get caught as is the case for the
> include statement, but let me first fix the Windows related part.
>
> jg
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users
>

_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users



More information about the ragel-users mailing list