Closed
Bug 1070689
Opened 10 years ago
Closed 10 years ago
Uninitialized variable 'rv' returned in dosprintf in jsprf.cpp.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: arai, Assigned: gokcehankara)
References
Details
Attachments
(1 file)
dosprintf returns uninitialized variable 'rv'.
http://dxr.mozilla.org/mozilla-central/source/js/src/jsprf.cpp#621
> if (!BuildArgArray(fmt, ap, nas)) {
> // the fmt contains error Numbered Argument format, jliu@netscape.com
> JS_ASSERT(0);
> return rv;
> }
It should be "return -1".
Assignee | ||
Comment 1•10 years ago
|
||
Looks like we missed that on the final version of the patch in the previous bug, sorry for that. We had talked about changing `dosprintf` and other functions here to return a `bool` instead of `int`. This could be done in this bug if it's appropriate. I'm already familiar with the code here so I can do it if noone else wants.
Updated•10 years ago
|
Flags: needinfo?(continuation)
Comment 2•10 years ago
|
||
(In reply to gokcehankara from comment #1)
> I'm already familiar with the code here so I
> can do it if noone else wants.
Sounds good to me, thanks.
Flags: needinfo?(continuation)
Comment 3•10 years ago
|
||
This bug is the last -Wuninitialized warning that clang and gcc report in mozilla-central. After it's fixed, I hope to enable -Wuninitialized warnings as errors in bug 1001975.
Blocks: Wuninitialized
Assignee | ||
Comment 4•10 years ago
|
||
I'm having a busy week at the moment, so I was hoping to take a look at this at the end of the week. If someone wants to take over it's fine by me. Alternatively, it might be easier to fix this bug simply with Tooru's suggestion (by changing `return rv;` to `return -1;`) and leave the refactoring to a different bug so that it won't block bug 1001975.
Comment 5•10 years ago
|
||
> This bug is the last -Wuninitialized warning that clang and gcc report in
> mozilla-central.
Oh, nice. I thought that making -Wuninitialized an error was a hopeless goal, but it looks like that's no longer the case.
Assignee | ||
Comment 6•10 years ago
|
||
I'm attaching a patch for changing the return type of functions in here (jsprf.cpp) from int (0 for success, -1 for failure) to bool (true for success, false for failure) except for public functions so they should work as before. This should fix this bug.
I haven't set anyone for review as I wasn't sure who to pick. Also I still don't have repo access so I'm gonna require some help with that either.
Assignee | ||
Updated•10 years ago
|
Attachment #8495905 -
Flags: review?(nicolas.b.pierron)
Comment 7•10 years ago
|
||
Comment on attachment 8495905 [details] [diff] [review]
1070689.patch - Change return type of dosprintf functions from int to bool (in jsprf.cpp)
Review of attachment 8495905 [details] [diff] [review]:
-----------------------------------------------------------------
Nice work.
Attachment #8495905 -
Flags: review?(nicolas.b.pierron) → review+
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
Thank you Nicolas..
Assignee: nobody → gokcehankara
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Comment 11•10 years ago
|
||
(In reply to gokcehankara from comment #9)
> Thank you Nicolas..
Do you know what you want to continue working on?
Assignee | ||
Comment 12•10 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #11)
> (In reply to gokcehankara from comment #9)
> > Thank you Nicolas..
>
> Do you know what you want to continue working on?
I don't have anything in mind so I'm open to suggestions if you have any. Since my school has started I would prefer something I could work on with a small pace.
Comment 13•10 years ago
|
||
(In reply to gokcehankara from comment #12)
> (In reply to Nicolas B. Pierron [:nbp] from comment #11)
> > Do you know what you want to continue working on?
>
> I don't have anything in mind so I'm open to suggestions if you have any.
> Since my school has started I would prefer something I could work on with a
> small pace.
I have a few bugs such as Bug 1062893, which are not urgent but are adding more capabilities of optimization to IonMonkey.
You need to log in
before you can comment on or make changes to this bug.
Description
•