Closed Bug 695495 Opened 13 years ago Closed 6 years ago

Traits.cpp fails to compile with Android NDK r6 release of the toolchain

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dschaffe, Assigned: dschaffe)

Details

Attachments

(1 file)

I ran into the Traits.cpp compile error when using Android NDK r6.

I found the problem was in Traits.cpp:727 in readNameEntry().  The compiler is complaining in the default of the switch neither id nor info (both uint32_t) are defined.  Seems to be in an error condition so I set id and info to 0.
Attached patch patchSplinter Review
Attachment #567866 - Flags: review?(fklockii)
OS: Mac OS X → Android
Hardware: x86 → ARM
the code should not get executed, from comments:
Traits.cpp:726
                // unsupported traits type -- can't happen, caught in AbcParser::parseTraits
+                id = 0;
+                info = 0;
                AvmAssert(0);
                break;
Fascinating, the compiler must be doing more flow analysis than I would have expected to be warning about this case.
changeset: 6664:d9a0641933d5
user:      Dan Schaffer <dschaffe@adobe.com>
summary:   Bug 695495: init all NameEntry fields, even when unreachable (r=fklockii).

http://hg.mozilla.org/tamarin-redux/rev/d9a0641933d5
The android compiler is super picky.  I had this structure in some code yesterday:

   case xxx:
     switch (x) {
     case yyy:
        goto blah;
     default:
        goto bletch;
     }
   blah:
     int z = ...;
     ...;
     break;
   bletch:
     ...

Here it complained that the variable z is uninitialized at bletch, which is not actually reachable from where the variable was defined.  Looks like it's going out of its way to ignore control flow in doing these analyses.
(i pushed the patch but I'll let dschaffe confirm that its all fixed and subsequently resolve this ticket.)
Assignee: nobody → dschaffe
Status: NEW → ASSIGNED
Attachment #567866 - Flags: review?(fklockii) → review+
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: