Advertisement

Bug in tokenizer on 64-bit?

Started by March 06, 2008 03:18 PM
0 comments, last by WitchLord 16 years, 8 months ago
I think I just ran into a bug in as_tokenizer.cpp. In line 118 (in 2.11.2), a loop is run on every character of the whitespace-string. The length of this string is determined by doing:
for( int w = 0; w < (int)sizeof(whiteSpace); w++ )


However, sizeof(whiteSpace) seems to give the size of the pointer to the string, which on 32-bit is 4 and incidentally correct. On 64-bit however, this becomes 8, which leads to all kinds of weird errors. Changing the line to
for( int w = 0; w < 4; w++ )


fixed these problems for me. [Edited by - DaBono on March 6, 2008 3:37:16 PM]
Thanks DaBono, you're right it is indeed a bug. Instead of sizeof it should have been strlen.

I'll fix this for the next release.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement