Skip to content

Commit

Permalink
opcodesswitch: add support for raw_raise
Browse files Browse the repository at this point in the history
Add support for raw_raise instruction that has been found in some code
compiled with Elixir.

Signed-off-by: Davide Bettio <davide@uninstall.it>
  • Loading branch information
bettio committed Aug 4, 2024
1 parent 1f06efc commit 70edf3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Implement `gpio:init/1` on esp32 to initialize pins for GPIO usage, which some pins
require depending on default function and bootloader code
- Implement missing opcode 161 (raw_raise), that looks more likely to be generated with Elixir code

## [0.6.3] - 20-07-2024

Expand Down
1 change: 1 addition & 0 deletions src/libAtomVM/opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
#define OP_GET_MAP_ELEMENTS 158
#define OP_IS_TAGGED_TUPLE 159
#define OP_BUILD_STACKTRACE 160
#define OP_RAW_RAISE 161
#define OP_GET_HD 162
#define OP_GET_TL 163
#define OP_PUT_TUPLE2 164
Expand Down
11 changes: 11 additions & 0 deletions src/libAtomVM/opcodesswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6102,6 +6102,17 @@ HOT_FUNC int scheduler_entry_point(GlobalContext *glb)
break;
}

case OP_RAW_RAISE: {

TRACE("raw_raise/0\n");

#ifdef IMPL_EXECUTE_LOOP
x_regs[2] = term_nil();
goto handle_error;
#endif
break;
}

case OP_GET_HD: {
term src_value;
DECODE_COMPACT_TERM(src_value, pc)
Expand Down

0 comments on commit 70edf3d

Please sign in to comment.