Closed Bug 856215 Opened 12 years ago Closed 12 years ago

Codegen for converting a sequence of sequences is buggy

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

We end up with something like this: for (uint32_t i = 0; i < length; ++i) { ... for (uint32_t i = 0; i < length; ++i) { ... if (!xpc::NonVoidStringToJsval(cx, currentValue[i][i], &tmp)) { which is obviously not a good idea.
Hrm. So the problem is that we don't actually know the type of currentValue[i] when we're generating this code, so we can't easily create a temporary for it. :( I need to think about this a tad....
So this is a bit annoying. I can hack this together, sort of, but it fails any time the declType of a method return value and dictionary member type are different, which they are for dictionary types for example. If we had C++11 decltype(), I could just decltype(currentValue)::elem_type. But we don't have that on all our supported platforms yet. Maybe I need to special-case sequence-of-sequences conversion to call a function of some sort. Or maybe I need to keep a global nesting level and name my counter variables with that level included.... That last might be simplest. :(
This is ugly, but seems to work....
Attachment #731424 - Flags: review?(khuey)
Valentin, does that patch help bug 843865?
Flags: needinfo?(valentin.gosu)
It seems to be working perfectly now. Thanks!
Flags: needinfo?(valentin.gosu)
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla23
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: