mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-21 02:31:01 +00:00
Fix bug where the Smalltalk source reader would accept an incomplete
exponent in a real number, e.g., '1e'. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@36774 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4298e255e7
commit
bfed68b1c3
2 changed files with 14 additions and 3 deletions
|
@ -3,8 +3,9 @@
|
|||
* STSourceReader.m (-lineNumberForIndex:, -readNextToken): Tidy
|
||||
source.
|
||||
|
||||
* STSourceReader.m (-readNextToken): Prevent out of range accesses for
|
||||
the input string.
|
||||
* STSourceReader.m (-readNextToken): Bug fixes:
|
||||
- Prevent out of range accesses for the input string.
|
||||
- Exponent of a real number must contain at least one digit.
|
||||
|
||||
2013-05-26 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
|
|
|
@ -428,7 +428,16 @@ static NSString *_STNormalizeStringToken(NSString *token)
|
|||
c = GET_CHAR;
|
||||
}
|
||||
|
||||
while ([numericCharacterSet characterIsMember:c])
|
||||
if (![numericCharacterSet characterIsMember:c])
|
||||
{
|
||||
srcOffset--;
|
||||
tokenRange = NSMakeRange(start, srcOffset - start + 1);
|
||||
[NSException raise:STCompilerSyntaxException
|
||||
format:@"Invalid character '%c' in exponent", c];
|
||||
return STErrorTokenType;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (AT_END)
|
||||
{
|
||||
|
@ -438,6 +447,7 @@ static NSString *_STNormalizeStringToken(NSString *token)
|
|||
|
||||
c = GET_CHAR;
|
||||
}
|
||||
while ([numericCharacterSet characterIsMember:c]);
|
||||
|
||||
if ([identStartCharacterSet characterIsMember:c])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue