[stlport-bugs] [ stlport-Bugs-1771153 ] _Stl_atod crash in MSVC2005 with Smaller Type Check
Brought to you by:
complement
From: SourceForge.net <no...@so...> - 2007-08-09 18:31:42
|
Bugs item #1771153, was opened at 2007-08-09 14:31 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=766244&aid=1771153&group_id=146814 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General code Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michel Donais (cpct0) Assigned to: Nobody/Anonymous (nobody) Summary: _Stl_atod crash in MSVC2005 with Smaller Type Check Initial Comment: num_get_float.cpp, line #522 and up /* Round to 53 bits */ rest = value & (1<<10)-1; value >>= 10; #if !defined(__SC__) guard = (uint32) value & 1; #else //*TY 03/25/2000 - guard = to_ulong(value & 1); #endif The line (526): guard = (uint32) value & 1; Should read : guard = (uint32)( value & 1 ); Under MSVC2005, with Smaller Type Check compiler option on, the line might have a large value, and will execute the conversion to (uint32) before the bitwise-and &, meaning under cases where the dc is bigger than a uint32, it will assert. Added study: This has the advantage of being numerically valid, as currently the compiler has to assume the uint32 value is getting plainly truncated. However, this has the disadvantage of doing a potential asm "load high 32 bits of value" followed by a "and to 0", while using a useless always-zero second register/memory variable. To make it execute in MSVC2005, I find this a small price to pay. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=766244&aid=1771153&group_id=146814 |