Closed Bug 1270814 Opened 8 years ago Closed 8 years ago

[Static Analysis][Uninitialized pointer field] In function constructor LoopUnroller::LoopUnroller

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1358979)

Attachments

(1 file)

The Static Analysis tool Coverity added that the pointers from class LoopUnroller are not initialized.  As we would like to adopt a more RAII and to get the code ready to integrate this clang-plugin: https://bugzilla.mozilla.org/show_bug.cgi?id=525063 we should initialized the pointers will nullptr.
Comment on attachment 8749623 [details]
MozReview Request: Bug 1270814 - initialize pointers from LoopUnroller. r?jdemooij

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51073/diff/1-2/
Attachment #8749623 - Attachment description: MozReview Request: Bug 1270814 - initialize pointers from Bug 1270814. r?jdemooij → MozReview Request: Bug 1270814 - initialize pointers from LoopUnroller. r?jdemooij
Attachment #8749623 - Flags: review?(jdemooij)
Comment on attachment 8749623 [details]
MozReview Request: Bug 1270814 - initialize pointers from LoopUnroller. r?jdemooij

https://reviewboard.mozilla.org/r/51073/#review48319

Thanks.

::: js/src/jit/LoopUnroller.cpp:25
(Diff revision 2)
>      typedef HashMap<MDefinition*, MDefinition*,
>                      PointerHasher<MDefinition*, 2>, SystemAllocPolicy> DefinitionMap;
>  
>      explicit LoopUnroller(MIRGraph& graph)
> -      : graph(graph), alloc(graph.alloc())
> +      : graph(graph), alloc(graph.alloc()),
> +        header(nullptr), backedge(nullptr), 

Nit: remove trailing whitespace on this line
Attachment #8749623 - Flags: review?(jdemooij) → review+
Comment on attachment 8749623 [details]
MozReview Request: Bug 1270814 - initialize pointers from LoopUnroller. r?jdemooij

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51073/diff/2-3/
https://hg.mozilla.org/mozilla-central/rev/cbb01e669859
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: