🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Bug in tokenizer on 64-bit?

Started by
0 comments, last by WitchLord 16 years, 4 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]
Advertisement
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