Bug 216082 - AbstractMacroAssembler::Jump class has uninitialized instance variables
Summary: AbstractMacroAssembler::Jump class has uninitialized instance variables
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-02 10:54 PDT by David Kilzer (:ddkilzer)
Modified: 2020-09-03 10:21 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1 (2.55 KB, patch)
2020-09-02 10:58 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2020-09-02 10:54:13 PDT
AbstractMacroAssembler::Jump class has uninitialized instance variables when using default (and other) constructors.

Found by clang static analyzer using the optin.cplusplus.UninitializedObject checker.
Comment 1 David Kilzer (:ddkilzer) 2020-09-02 10:58:02 PDT
Created attachment 407778 [details]
Patch v1
Comment 2 David Kilzer (:ddkilzer) 2020-09-02 11:00:14 PDT
Comment on attachment 407778 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=407778&action=review

> Source/JavaScriptCore/assembler/AbstractMacroAssembler.h:685
> +        bool m_is64Bit { false };

Should this be { true } instead since this is only compiled on CPU(ARM64)?  Or do we have 32-bit jumps in arm64[e]?
Comment 3 Michael Saboff 2020-09-02 11:40:15 PDT
Comment on attachment 407778 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=407778&action=review

r=me.  This is good defensive programming, but I don't think that this fixes any latent bugs as these fields are set for the instruction variants that use them.

>> Source/JavaScriptCore/assembler/AbstractMacroAssembler.h:685
>> +        bool m_is64Bit { false };
> 
> Should this be { true } instead since this is only compiled on CPU(ARM64)?  Or do we have 32-bit jumps in arm64[e]?

All jumps for ARM64[e] are 64 bit in terms of changes to the PC.  The m_is64Bit is for the compare and branch jumps (CBZ and CBNZ) and relate to the size of the comparison.  The m_is64Bit flag is not used for the other branch types.
Comment 4 David Kilzer (:ddkilzer) 2020-09-03 10:07:11 PDT
Comment on attachment 407778 [details]
Patch v1

Adding cq+ since failures in fast/block/margin-collapse/103.html are happening across multiple patches.  Not related to this patch.
Comment 5 EWS 2020-09-03 10:20:50 PDT
Committed r266530: <https://trac.webkit.org/changeset/266530>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407778 [details].
Comment 6 Radar WebKit Bug Importer 2020-09-03 10:21:17 PDT
<rdar://problem/68287015>