Sun 05 Nov 2006 08:47:22 PM UTC, comment #10:
Well, since I was the original reporter, and I can confirm the
bug is gone, I'll just consider this item as closed (segfault)
As for the 'substring' opcode, in case Udo finds out a way
to actually generate it I suggest a new bug item is opened (if we have a bug there, who knows). Maybe we can just forget about this
all thing and wait for somebody else to report eventual failures :)
|
Sun 05 Nov 2006 08:14:57 PM UTC, comment #9:
About substring opcode:
http://sswf.m2osw.com/SWFalexref.html#action_substring
I've fixed handling of your testcases, btw in both head and 0.7.2 branches (implementing automatic cast of strings to String objects and numbers to Number objects when attempting to call methods of them)
|
Sun 05 Nov 2006 05:57:08 PM UTC, comment #8:
It's exported to SWF 6 (MX). Do you have any info on the opcode? Maybe it must be used like substring(str, 0, 5)...
Can't use any tools before tomorrow afternoon
|
Sun 05 Nov 2006 05:32:55 PM UTC, comment #7:
Nope, that's the same thing.
Maybe the substring opcode will be generated by
setting a target SWF to an older version ?
Can you use 'flasm' to disassemble the swf yourself so
you can directly check ?
You should see a 'substring' opcode listed,
take my first attachment as reference.
|
Sun 05 Nov 2006 05:25:24 PM UTC, comment #6:
No clue how to generate that opcode, I just took your reference.
The new version (#11167) uses this code:
var str=new String("a_string");
if (str.substring(0, 4) == "a_st")
trace("PASSED:substring(0,4)");
else
trace("FAILED:substring(0,4)");
if (str.substring(-3, 4) == "a_st")
trace("PASSED:substring(-3,4)");
else
trace("FAILED:substring(-3,4)");
if (str.substring(0, -1) == "")
trace("PASSED:substring(0,-1)");
else
trace("FAILED:substring(0,-1)");
if (str.substring(4) == "ring")
trace("PASSED:substring(4)");
else
trace("FAILED:substring(4)");
if (str.substring(16) == "")
trace("PASSED:substring(16)");
else
trace("FAILED:substring(16)");
if (str.substring(-16) == "a_string")
trace("PASSED:substring(-16)");
else
trace("FAILED:substring(-16)");
|
Sun 05 Nov 2006 05:18:45 PM UTC, comment #5:
Nope, that's not using 'substring' opcode:
push 4, -3, 2, 'a_string', 'substring'
callMethod
It's calling the 'substring' method.
(also a bug not finding it, but that's another one)
|
Sun 05 Nov 2006 05:10:18 PM UTC, comment #4:
Here you are.
ActionScript code for reference:
if ("a_string".substring(0, 4) == "a_st")
trace("PASSED:substring(0,4)");
else
trace("FAILED:substring(0,4)");
if ("a_string".substring(-3, 4) == "a_st")
trace("PASSED:substring(-3,4)");
else
trace("FAILED:substring(-3,4)");
if ("a_string".substring(0, -1) == "")
trace("PASSED:substring(0,-1)");
else
trace("FAILED:substring(0,-1)");
if ("a_string".substring(4) == "ring")
trace("PASSED:substring(4)");
else
trace("FAILED:substring(4)");
if ("a_string".substring(16) == "")
trace("PASSED:substring(16)");
else
trace("FAILED:substring(16)");
if ("a_string".substring(-16) == "a_string")
trace("PASSED:substring(-16)");
else
trace("FAILED:substring(-16)");
|
Sun 05 Nov 2006 01:34:51 PM UTC, comment #3:
What I need is an SWF that contains the 'substring' opcode (0x15)
used in all valid (and some invalid) ways.
For example:
"a_string".substring(0, 4) == ??
"a_string".substring(-3, 4) == ??
"a_string".substring(0, -1) == ??
"a_string".substring(4) == ??
"a_string".substring(16) == ??
"a_string".substring(-16) == ?
...
The ?? should be replaced with the expected
result and the checks should be embedded in a condition
that either triggers trace("FAILED: <statement>") or
trace("PASSED: <statement>")
|
Sun 05 Nov 2006 12:40:20 PM UTC, comment #2:
I can create any kind of movie you want, just tell me what you need. I don't know what kind of assertion failure this is as I can't run Gnash right now. If you don't want to wait, let me know what exactly you need. A substring test case like in the other bug item?
|
Sun 05 Nov 2006 11:30:56 AM UTC, comment #1:
It turns out that the given string was either NULL or UNDEFINED.
I committed a fix handling this case, but I really think the
whole ActionSubString function needs a complete rewrite driven
by a deep testcase.
Unfortunately Ming seems unable to output such opcode (substring)
replacing it with calls to the substring() method instead.
A complete testcase for 'primitive-string' substring would help
finishing it, anyway, one segfault less for 0.7.2.
REF ming bug:
http://bugs.libming.org/show_bug.cgi?id=6
oh, btw.. if 'base' is 0 there still is a bug.. we really need that testcase. Added Udo for this :)
|
Sun 05 Nov 2006 10:22:56 AM UTC, original submission:
attached movie triggers an assertion failure
|