Changeset 246332 in webkit
- Timestamp:
- Jun 11, 2019, 2:06:45 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/urshift-int32-overflow.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r246321 r246332 1 2019-06-10 Tadeu Zagallo <tzagallo@apple.com> 2 3 AI BitURShift's result should not be unsigned 4 https://bugs.webkit.org/show_bug.cgi?id=198689 5 <rdar://problem/51550063> 6 7 Reviewed by Saam Barati. 8 9 * stress/urshift-int32-overflow.js: Added. 10 (foo.): 11 (foo): 12 1 13 2019-06-11 Guillaume Emont <guijemont@igalia.com> 2 14 -
trunk/Source/JavaScriptCore/ChangeLog
r246328 r246332 1 2019-06-10 Tadeu Zagallo <tzagallo@apple.com> 2 3 AI BitURShift's result should not be unsigned 4 https://bugs.webkit.org/show_bug.cgi?id=198689 5 <rdar://problem/51550063> 6 7 Reviewed by Saam Barati. 8 9 Treating BitURShift's result as unsigned in the abstract interpreter incorrectly overflows it. 10 This breaks the DFG and FTL, since they assume that BitURShift's result is an int32 value, but 11 get a double constant from AI. Since the result will be converted to unsigned by UInt32ToNumber, 12 all we have to do is store the result as a signed int32. 13 14 * dfg/DFGAbstractInterpreterInlines.h: 15 1 16 2019-06-11 Michael Catanzaro <mcatanzaro@igalia.com> 2 17 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r246210 r246332 500 500 break; 501 501 case BitRShift: 502 setConstant(node, JSValue(a >> static_cast<uint32_t>(b)));502 setConstant(node, JSValue(a >> (static_cast<uint32_t>(b) & 0x1f))); 503 503 break; 504 504 case BitLShift: 505 setConstant(node, JSValue(a << static_cast<uint32_t>(b)));505 setConstant(node, JSValue(a << (static_cast<uint32_t>(b) & 0x1f))); 506 506 break; 507 507 case BitURShift: 508 setConstant(node, JSValue(static_cast< uint32_t>(a) >> static_cast<uint32_t>(b)));508 setConstant(node, JSValue(static_cast<int32_t>(static_cast<uint32_t>(a) >> (static_cast<uint32_t>(b) & 0x1f)))); 509 509 break; 510 510 default:
Note:
See TracChangeset
for help on using the changeset viewer.