Bug 266505

Summary: DFG node flags are erroneously masked off in ArithClz32
Product: WebKit Reporter: David Degazio <d_degazio>
Component: JavaScriptCoreAssignee: David Degazio <d_degazio>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

David Degazio
Reported 2023-12-15 14:11:50 PST
rdar://119694893 In the DFG backwards propagation phase, when we modify the flags of an ArithClz32 node, we run the following: flags &= ~(... | ~NodeBytecodePrefersArrayIndex); In other nodes, we mask off bits for propagatable flags that shouldn't be propagated past the current node - for instance, bitwise operations mask off NodeBytecodeUsesAsNumber, since other nodes up the chain will be used as integers in the bitwise op. But here, we are including the negation of NodeBytecodePrefersArrayIndex, and due to the double negative in this statement, this has the effect of masking off all flags other than NodeBytecodePrefersArrayIndex. This looks like a typo, although since the behavior is already to mask off almost all bits in the backwards propagation mask, the only adverse effect is we might propagate NodeBytecodePrefersArrayIndex to the child nodes (unnecessary since we know the Clz32 will always return an int, making the existing PrefersArrayIndex bit redundant, but I can't find anywhere where preferring an array index would cause problems).
Attachments
David Degazio
Comment 1 2023-12-15 14:18:05 PST
EWS
Comment 2 2023-12-19 14:52:49 PST
Committed 272302@main (552c7a956d0e): <https://commits.webkit.org/272302@main> Reviewed commits have been landed. Closing PR #21890 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.