Closed Bug 1273103 Opened 4 years ago Closed 4 years ago

[Static Analysis][Uninitialized scalar field] In constructor FlowGraphSummary::Entry

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1361787)

Attachments

(1 file)

The Static Analysis tool Coverity added that variables |lineno_|, |column_| are uninitialized. As we are trying to push for a more RAII architecture and we want to prepare our code for this clang-plugin - 525063. We should initialize these member variables.
Attachment #8752764 - Flags: review?(jorendorff) → review+
Comment on attachment 8752764 [details]
MozReview Request: Bug 1273103 - initialize |lineno_|, |column_|. r?jorendorff

https://reviewboard.mozilla.org/r/52796/#review49976

::: js/src/vm/Debugger.cpp:5525
(Diff revision 1)
>  
>          static Entry createWithMultipleEdgesFromMultipleLines() {
>              return Entry(SIZE_MAX, SIZE_MAX);
>          }
>  
> -        Entry() {}
> +        Entry() : lineno_(0), column_(0) {}

`lineno_(SIZE_MAX), column_(0)`, please, and then delete these lines from `populate()`:

    for (size_t i = mainOffset + 1; i < script->length(); i++)
        entries_[i] = Entry::createWithNoEdges();
Comment on attachment 8752764 [details]
MozReview Request: Bug 1273103 - initialize |lineno_|, |column_|. r?jorendorff

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