Skip to content

v0.3.0

Latest

Choose a tag to compare

@fjl fjl released this 24 Oct 13:37
· 3 commits to master since this release

This release brings significant improvements to the expression language, as well as the ability to insert arbitrary bytes into the assembler's bytecode output.

Language

  • The new #bytes directive inserts raw bytes into the output.
  • There is also a way to "name" #bytes, which allow expressions to reference the length and output offset of the inserted bytes.
  • Values used by expression language computations now keep track of leading zero bytes.
  • Operator precedence has been changed to match Go. This is a backwards-incompatible change, which could lead to expressions being evaluated differently. Previously, operator precedence was C-like, with an ordering of multiplication > addition > bit-shifts > logic. The new precedence is simpler with only two levels: * / % & << >> (multiplication/and/shift) bind stronger than + - | ^ (addition/or).
  • Unary minus is now supported in expressions.
  • Escape sequences \n, \r, \t, \\, \", \xFF can be used in strings.
  • Dotted labels (i.e. labels without JUMPDEST) can now be accessed without the dot. This change is meant to make source text look less intimidating. No backwards-compatibility issues can result from this, since dotted and non-dotted labels share a namespace.
  • Similarly, it is now possible to call builtin macros without writing the dot prefix, i.e. you can write abs(-1) instead of .abs(-1).
  • Builtin macros bitlen(), bytelen() have been renamed to intbits() and len(). Their legacy equivalents are still present, but will produce a deprecation warning when used.
  • The #assemble directive has been deprecated in favor of a new assemble() builtin expression macro. You can use assemble() in combination with #bytes to do what #assemble did.

Disassembler

  • Invalid opcodes are printed as #bytes instead of erroring.
  • When disassembling with logical blocks, terminating instructions (STOP etc.) are treated as a block separator.

Targets

  • Geas now supports EVM opcodes added by in the Tron network (#19)