aaron-nance / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

Is it a bug #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
A Error output:
cannot convert org.as3commons.bytecode.abc::MultinameG@244e1511 to 
org.as3commons.bytecode.abc.QualifiedName。
    at org.as3commons.bytecode.abc::ConstantPool/addMultiname()
    at org.as3commons.bytecode.io::AbcSerializer/serializeMethodInfo()
    at org.as3commons.bytecode.io::AbcSerializer/serializeAbcFile()
    at org.as3commons.bytecode.tags.serialization::DoABCSerializer/write()
    at org.as3commons.bytecode.swf::SWFWeaverFileIO/writeTag()
    at org.as3commons.bytecode.swf::SWFWeaverFileIO/write()
    at test_fla::MainTimeline/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

This is my code:
var bytes:ByteArray = loader.data(ByteArray of a swf);
var input:SWFFileIO = new SWFFileIO();
var swf:SWFFile = input.read(bytes);
var cache:ByteArray = new ByteArray();
input.write(cache, swf);

Then I download the source code from svn,change the code in ConstantPools.as 
line 302.
"for each (var qn:QualifiedName in mg.parameters) {"  to
"for each (var qn:* in mg.parameters) {".
The error disappear.

Original issue reported on code.google.com by chengke...@gmail.com on 5 Dec 2011 at 11:11

GoogleCodeExporter commented 8 years ago
Interesting, I've never encountered a SWF that contained Multinames for 
parameters, I'd expect all of them to be qualified names.
Is it possible for you to post the SWF here that you're deserialzing? I'd like 
to take a look, if that's possible.

Thanks for bringing this issue to our attention!

cheers,

Roland

Original comment by ihatelivelyids on 5 Dec 2011 at 10:20

GoogleCodeExporter commented 8 years ago
Hi.
I have the same problem.

Original comment by devi...@gmail.com on 7 Feb 2012 at 1:51

GoogleCodeExporter commented 8 years ago
            if (multiname is MultinameG) {
                var mg:MultinameG = MultinameG(multiname);
                addMultiname(mg.qualifiedName);
                for each (var qn: MultinameG in mg.parameters) {
                    addMultiname(qn);
                }
            }

this issue appear, when mg is Vector

Original comment by devi...@gmail.com on 7 Feb 2012 at 1:57

GoogleCodeExporter commented 8 years ago
Hi there,

I guess I understand now what's going on, I'll try and fix this a.s.a.p.
Thanks a lot for reporting this.

Roland

Original comment by ihatelivelyids on 7 Feb 2012 at 2:10

GoogleCodeExporter commented 8 years ago
Ok, I added a very simple fix, instead of

for each (var qn:QualifiedName in mg.parameters)

it is now:

for each (var qn:BaseMultiname in mg.parameters)

that ought to prevent some runtime errors.

please confirm that it works for you now.

Roland

Original comment by ihatelivelyids on 7 Feb 2012 at 2:17

GoogleCodeExporter commented 8 years ago
It fixed runtime errors, but created swf file, won't open.

Also in new file I see this code(decompile):
private var m_States:Vector.<Decoration>;

instead of
private var m_States:Vector.<GameState>;

In other classses i see same problem, but with other Vector arguments.
P.S. not in all Vectors

Original comment by devi...@gmail.com on 7 Feb 2012 at 3:14

GoogleCodeExporter commented 8 years ago
Hi there,

I think I managed to fix the problems we've been experiencing with Vectors. 
There was quite a glaring error in the serialization that caused this.
Changes are available in the trunk, expect a new as3commons-bytecode release 
soon (v1.1.1 I'm guessing).

Cheers,

Roland

Original comment by ihatelivelyids on 31 Mar 2012 at 6:09