Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix pushliteral opcodes for negative values.

  • Loading branch information...
commit 9e6f833cd8231385dc95e3ae54cbedcdb4143791 1 parent 7bae041
@whitequark authored
View
2  lib/furnace-avm2/abc/opcodes/push_literal/as3_pushbyte.rb
@@ -3,7 +3,7 @@ class AS3PushByte < PushLiteralOpcode
instruction 0x24
body do
- uint8 :value
+ int8 :value
end
type :integer
View
2  lib/furnace-avm2/abc/opcodes/push_literal/as3_pushshort.rb
@@ -3,7 +3,7 @@ class AS3PushShort < PushLiteralOpcode
instruction 0x25
body do
- vuint30 :value
+ vint32 :value
end
type :integer
View
14 lib/furnace-avm2/binary/record.rb
@@ -186,6 +186,20 @@ def length_uint8(value, options)
1
end
+ # int8
+
+ def read_int8(io, options)
+ io.read(1).unpack("c").at(0)
+ end
+
+ def write_int8(io, value, options)
+ io.write([value].pack("c"))
+ end
+
+ def length_int8(value, options)
+ 1
+ end
+
# uint16
def read_uint16(io, options)
View
2  test/basic.as
@@ -1,7 +1,7 @@
package test {
class Literal {
function test() {
- call(1, 1, 200, 200);
+ call(1, 1, 200, 200, -1, -50, 32767, 32768, -32760, -500000);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.