Bug 4227 - Sign mismatch with negative numbers in $evalfloat and $evalint
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: All All
: P3 minor
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2009-07-05 21:01 EDT by Makro
Modified: 2009-10-19 19:30:09 EDT
1 user (show)

See Also:



Description Makro 2009-07-05 21:01:44 EDT
There's a bug in the PC_DollarDirective_evalint and PC_DollarDirective_evalfloat functions in botlib/l_precomp.c that causes a sign mismatch in the token that is pushed on the stack if the result is negative. The problem is that token.string gets sprintf'ed to the absolute value of the result, but token.floatvalue retains the sign, which is incorrect, considering the extra sign token that is pushed on the stack (with UnreadSignToken). As a bonus, token.intvalue (unsigned long) gets the same value as token.floatvalue!

Expected behaviour: both token.intvalue and token.floatvalue should be assigned [f]abs(value).
Comment 1 Thilo Schulz 2009-10-19 19:30:09 EDT
Fixed in r1688