Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fbc: sf.net # 994: Bad handling of macro argument evaluation
- reset file pointers after evaluating arguments in __fb_query_symbol__, __fb_eval__, __fb_arg_extract__, __fb_iif__ - Some fbc built in macros like create a separate lexer context to evaluate arguments at compile time. - When the lexer context is no longer needed, the previous lexer context needs to be restored. - fbc was failing to correctly restore file pointers after freeing the context - this would result in the file pointers being not synchronized with the memory buffers and memory pointers - this would happen when the macros and arguments to be expanded sit on either side of an 8Kb boundary - 8KB is the hard coded buffer size for reading in chunks of source code
- Loading branch information
Showing
11 changed files
with
145 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
const fbc_FB_QUERY_SYMBOL_symbclass = 0 | ||
#macro SomeLongishExpressionToHitTheBadSpot(longish_argument_name) | ||
longish_argument_name | ||
#endmacro | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' Padding to fill the source file to 8Kb--------------------------------------- | ||
'' That should be close enough | ||
print __FB_QUERY_SYMBOL__( _ | ||
SomeLongishExpressionToHitTheBadSpot( fbc_FB_QUERY_SYMBOL_symbclass ), _ | ||
SomeUndefinedSymbol ) | ||
print "This is the last lines of the file - This is the last lines of the file" | ||
print "This is the last lines of the file - This is the last lines of the file" | ||
print "This is the last lines of the file - This is the last lines of the file" | ||
print "This is the last lines of the file - This is the last lines of the file" | ||
print "This is the last lines of the file - This is the last lines of the file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fb_query_symbol-error-1.bas(101) error 42: Variable not declared, SomeUndefinedSymbol in 'SomeUndefinedSymbol )' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fb_query_symbol-error-1.bas(101) error 42: Variable not declared, SomeUndefinedSymbol in 'SomeUndefinedSymbol )' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fb_query_symbol-error-1.bas(101) error 42: Variable not declared, SomeUndefinedSymbol in 'SomeUndefinedSymbol )' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fb_query_symbol-error-1.bas(101) error 42: Variable not declared, SomeUndefinedSymbol in 'SomeUndefinedSymbol )' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fb_query_symbol-error-1.bas(101) error 42: Variable not declared, SomeUndefinedSymbol in 'SomeUndefinedSymbol )' |