Closed
Bug 558863
Opened 15 years ago
Closed 14 years ago
in operator on bytearray throws exception for non-natural number
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
Q3 11 - Serrano
People
(Reporter: pnkfelix, Assigned: pnkfelix)
References
Details
Attachments
(2 files, 6 obsolete files)
(deleted),
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
The expression (x in b) where b is a ByteArray object and x is not a nonnegative integer throws an Exception.
The Exception is a ReferenceError complaining that the Property is not found and has no default value. The attached file illustrates some of these cases.
My hypothesis is that this is an artifact of hasAtomProperty being implemented in terms of getAtomProperty (and assuming getAtomProperty will not throw an exception).
Assignee | ||
Comment 1•15 years ago
|
||
bug 458419 seems eerily similar; it probably suggests a fix.
Assignee | ||
Comment 2•15 years ago
|
||
This is simpler than Erik Tierney's fix to VectorClass (see http://hg.mozilla.org/tamarin-redux/rev/255af38d8bd4 ) as that called out to a special getVectorIndex method for reasons that are currently unclear to me.
So it could be that something more complicated is necessary here. Or it could be that the VectorClass code may be simplified in the same way.
Assignee: nobody → fklockii
Assignee | ||
Comment 3•15 years ago
|
||
Also, Mike Morearty warned me that there is duplicate code for ByteArrayGlue.cpp in the flash player source repository, and that needs to be kept in sync with the code here. He pointed me at:
//depot/main/FlashRuntime/Main/code/flash/avmglue in perforce
I assume an analogous patch there would be straight-forward.
Assignee | ||
Comment 4•15 years ago
|
||
Finally, tharhood pointed out that due to lack of API versioning, we may not be able to fix this bug in this release. I'm not sure at what level of the API needs to stay consistent; certainly Flash 10.0 exhibits a similar bug. (Flash 10.0 cannot run the attached test case but it is easy to rewrite it to use the writeByte method instead of a setter to construct the initial byte array.)
Status: NEW → ASSIGNED
Flags: flashplayer-qrb+
Flags: flashplayer-needsversioning+
Priority: -- → P3
Target Milestone: --- → flash10.2
Assignee | ||
Comment 5•14 years ago
|
||
Updated the test case to work in Strict mode. (Today I learned that Actionscript does not overload the XOR ^ operator to work on Booleans.)
Attachment #438534 -
Attachment is obsolete: true
Assignee | ||
Comment 6•14 years ago
|
||
(should this go to Ed instead, Steven? Or someone else? Let me know.)
Attachment #438583 -
Attachment is obsolete: true
Attachment #471521 -
Flags: review?(stejohns)
Assignee | ||
Comment 7•14 years ago
|
||
(ditto; let me know if someone else is better to review.)
Attachment #470868 -
Attachment is obsolete: true
Attachment #471522 -
Flags: review?(stejohns)
Comment 8•14 years ago
|
||
Comment on attachment 471521 [details] [diff] [review]
avoid exn throws for bytearray in op, versioned
Nit: Edwin has requested that for new code, we prefer a positive bug test, ie
if (bugzillaXXX) // fixed code
else /// old busted code
rather than
if (!bugzillaXXX) // old busted code
else // fixed code
otherwise, looks fine
Attachment #471521 -
Flags: review?(stejohns) → review+
Comment 9•14 years ago
|
||
Comment on attachment 471521 [details] [diff] [review]
avoid exn throws for bytearray in op, versioned
BTW, note that Flash/AIR currently have a similar-but-not-identical version of ByteArray hosted in their own glue code; this patch will have to land there too. (We are way overdue to unify the two...)
Comment 10•14 years ago
|
||
Comment on attachment 471522 [details] [diff] [review]
regression test
I think we are preferring the USE_BUGCOMPAT (or is it USE_SWFVERSION) approach for all new tests of this sort, rather than avm_args. Otherwise looks fine. (Err, except for the commented-out "trace", which probably should be nuked.)
Attachment #471522 -
Flags: review?(stejohns) → review-
Comment 11•14 years ago
|
||
Comment on attachment 471522 [details] [diff] [review]
regression test
I think we are preferring the USE_BUGCOMPAT (or is it USE_SWFVERSION) approach
for all new tests of this sort, rather than avm_args. Otherwise looks fine.
(Err, except for the commented-out "trace", which probably should be nuked.)
Assignee | ||
Comment 12•14 years ago
|
||
(In reply to comment #11)
> Comment on attachment 471522 [details] [diff] [review]
> regression test
>
> I think we are preferring the USE_BUGCOMPAT (or is it USE_SWFVERSION) approach
> for all new tests of this sort, rather than avm_args.
Hmm, could have sworn I tried that and it did not work (which I admit was disturbing). Will try again later today.
Assignee | ||
Comment 13•14 years ago
|
||
Revised to address nit posed by Stephen (about whether if-test should use !bz or bz).
Prior version used control-flow to avoid indentation drift, but I don't really have a preference between the two variants, so I'll go with the flow here.
Attachment #471521 -
Attachment is obsolete: true
Assignee | ||
Comment 14•14 years ago
|
||
Comment on attachment 477984 [details] [diff] [review]
avoid exn throws for bytearray in op, versioned
(it was r+'d by stejohns before the nit-fix, btw.)
Assignee | ||
Comment 15•14 years ago
|
||
revised to use USES_SWFVERSION keyword. Not sure what was wrong for me before (maybe I was doing USES_BUGCOMPAT).
Seems to work; will fire off a smoke-test shortly.
Attachment #471522 -
Attachment is obsolete: true
Attachment #477988 -
Flags: review?(stejohns)
Assignee | ||
Comment 16•14 years ago
|
||
prior attachment was erroneous (was old patch that did not yet address the nit).
This is the one I was talking about in comment 13.
Attachment #477984 -
Attachment is obsolete: true
Updated•14 years ago
|
Attachment #477992 -
Flags: review+
Updated•14 years ago
|
Attachment #477988 -
Flags: review?(stejohns) → review+
Assignee | ||
Comment 17•14 years ago
|
||
pushed TR: http://hg.mozilla.org/tamarin-redux/rev/9350e38c5e53
(missing the domain from my email address, oops; artifact of reusing old patches without sufficient "hg qrefresh" magic.)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Flags: flashplayer-bug+
You need to log in
before you can comment on or make changes to this bug.
Description
•