Closed Bug 962080 Opened 6 years ago Closed 6 years ago

js/src/jit/IonBuilder.cpp:4105:9: warning: ‘inlineable’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Categories

(Core :: JavaScript Engine: JIT, defect)

All
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Patch coming in a moment.
Good practice to always provide default cases for switches anyway.
Attachment #8362966 - Flags: review?(jdemooij)
Comment on attachment 8362966 [details] [diff] [review]
fix maybe-uninitialized variable warning in IonBuilder.cpp

Review of attachment 8362966 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jit/IonBuilder.cpp
@@ +4098,5 @@
>              inlineable = true;
>              break;
> +          case InliningDecision_Error:
> +          default:
> +            return false;

Can you instead add a MOZ_ASSUME_UNREACHABLE? If somebody adds a new enum value, we should fail somehow if he/she forgets to handle it here instead of silently treating it as OOM.
Attachment #8362966 - Flags: review?(jdemooij)
Now with less code rearrangement and more MOZ_ASSUME_UNREACHABLE.
Attachment #8363695 - Flags: review?(jdemooij)
Attachment #8362966 - Attachment is obsolete: true
Comment on attachment 8363695 [details] [diff] [review]
fix maybe-uninitialized variable warning in IonBuilder.cpp

Review of attachment 8363695 [details] [diff] [review]:
-----------------------------------------------------------------

Awesome, thanks!
Attachment #8363695 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/mozilla-central/rev/9b7841bd2c75
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.