Skip to content

Commit

Permalink
support of longjmp frpm shared object
Browse files Browse the repository at this point in the history
  • Loading branch information
dimas1185 committed Feb 11, 2023
1 parent ea20dd0 commit d1d41aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions libraries/native/crt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ extern "C" {
}
}

jmp_buf* __get_jmp_buf() {
return ___env_ptr;
}
void __set_env_test() {
___env_ptr = &test_env;
}
Expand Down
3 changes: 3 additions & 0 deletions libraries/native/crt_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ static jmp_buf env;
static jmp_buf test_env;
jmp_buf* ___env_ptr = &env;

jmp_buf* __get_jmp_buf() {
return ___env_ptr;
}
void __set_env_test() {
___env_ptr = &test_env;
}
Expand Down
12 changes: 7 additions & 5 deletions libraries/native/native/eosio/crt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ namespace eosio { namespace cdt {

extern eosio::cdt::output_stream std_out;
extern eosio::cdt::output_stream std_err;
extern "C" jmp_buf* ___env_ptr;
extern "C" char* ___heap_ptr;
extern "C" bool ___disable_output;
extern "C" bool ___has_failed;
extern "C" bool ___earlier_unit_test_has_failed;

extern "C" {
extern jmp_buf* ___env_ptr;
extern char* ___heap_ptr;
extern bool ___disable_output;
extern bool ___has_failed;
extern bool ___earlier_unit_test_has_failed;

jmp_buf* __get_jmp_buf();
void __set_env_test();
void __reset_env();
void _prints_l(const char* cstr, uint32_t len, uint8_t which);
Expand Down

0 comments on commit d1d41aa

Please sign in to comment.