Closed
Bug 508617
Opened 16 years ago
Closed 16 years ago
MethodEnv::initproperty can inappropriately reject const initialization
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P2)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
VERIFIED
FIXED
flash10.1
People
(Reporter: stejohns, Assigned: stejohns)
References
Details
Attachments
(1 file, 1 obsolete file)
|
15.12 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
given:
class A
{
private const foo:Object = new Object();
public function A()
{
}
}
class B extends A
{
public function B()
{
super();
}
}
var b:B = new B();
this runs correctly with JIT enabled, but in interp-only mode, fails (incorrectly) with
ReferenceError: Error #1074: Illegal write to read-only property foo.as$1:A::foo on foo.as$1.B
Comment 1•16 years ago
|
||
something like
class A
{
private const foo:Object
public function A() {
this["foo"] = new Object()
}
}
could trigger the same failure with JIT enabled, by circumventing early binding in the JIT.
| Assignee | ||
Comment 2•16 years ago
|
||
(In reply to comment #1)
> something like
>
> class A
> {
> private const foo:Object
>
> public function A() {
> this["foo"] = new Object()
> }
> }
>
> could trigger the same failure with JIT enabled, by circumventing early binding
> in the JIT.
maybe, but it doesn't seem to, regardless of jit mode
| Assignee | ||
Comment 3•16 years ago
|
||
This patch fixes the misbehavior. (It also deletes some unrelated stale code from MNHT).
Note that this might cause previously-function programs to fail.
Assignee: nobody → stejohns
Attachment #393059 -
Flags: review?(edwsmith)
Comment 4•16 years ago
|
||
This patch should be pushed in with the fix.
Testcase currently fails with "ReferenceError: Error #1074" when running with -Dinterp
Updated•16 years ago
|
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb?
| Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 393185 [details] [diff] [review]
Testcase
an equivalent testcase is actually already be included in the first patch above. (isn't it?)
Updated•16 years ago
|
Attachment #393185 -
Attachment is obsolete: true
Comment 6•16 years ago
|
||
Comment on attachment 393185 [details] [diff] [review]
Testcase
Sorry, didn't even look at the first patch.
Flags: flashplayer-qrb? → flashplayer-qrb+
Priority: -- → P2
Target Milestone: --- → flash10.1
(In reply to comment #3)
>
> Note that this might cause previously-function programs to fail.
Steven, how could this patch cause a failure on previously functioning code? The interpreter code would return an (incorrect) error and the JIT would allow the access. What's the failure situation?
| Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7)
> (In reply to comment #3)
> >
> > Note that this might cause previously-function programs to fail.
>
> Steven, how could this patch cause a failure on previously functioning code?
> The interpreter code would return an (incorrect) error and the JIT would allow
> the access. What's the failure situation?
If the code *expected* an exception to be thrown, and it no longer was, it might fail. (This is a pretty unlikely scenario since it's interp-only, but still...)
Comment 9•16 years ago
|
||
Comment on attachment 393059 [details] [diff] [review]
Patch
looks good and also removes MH_CACHE1 which we discussed recently.
Attachment #393059 -
Flags: review?(edwsmith) → review+
| Assignee | ||
Comment 10•16 years ago
|
||
pushed as changeset: 2516:d18863e7f76c
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 12•16 years ago
|
||
Verified fixed w/ avm 2780; Initial patch also pushed testcase: test/acceptance/misc/bug_508617.as
Status: RESOLVED → VERIFIED
Flags: in-testsuite? → in-testsuite+
Comment 13•16 years ago
|
||
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #3)
> > >
> > > Note that this might cause previously-function programs to fail.
> >
> > Steven, how could this patch cause a failure on previously functioning code?
> > The interpreter code would return an (incorrect) error and the JIT would allow
> > the access. What's the failure situation?
>
> If the code *expected* an exception to be thrown, and it no longer was, it
> might fail. (This is a pretty unlikely scenario since it's interp-only, but
> still...)
It is unlikely for plain functions to be interpreted in practice, but it is very likely for init code (global code and class static init code) to be interpreted. so the most likely place to consider for breaking existing code (by suppressing the incorrect exception) would be code that initializes static const class members or global consts.
You need to log in
before you can comment on or make changes to this bug.
Description
•