diff options
Diffstat (limited to 'erts/emulator/beam/bif.h')
-rw-r--r-- | erts/emulator/beam/bif.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/erts/emulator/beam/bif.h b/erts/emulator/beam/bif.h index 05e9b78c28..4342a6cf4e 100644 --- a/erts/emulator/beam/bif.h +++ b/erts/emulator/beam/bif.h @@ -125,7 +125,7 @@ do { \ #define ERTS_BIF_PREP_TRAP0(Ret, Trap, Proc) \ do { \ (Proc)->arity = 0; \ - (Proc)->def_arg_reg[3] = (Eterm) (Trap->address); \ + *((UWord *) (UWord) ((Proc)->def_arg_reg + 3)) = (UWord) ((Trap)->address); \ (Proc)->freason = TRAP; \ (Ret) = THE_NON_VALUE; \ } while (0) @@ -134,7 +134,8 @@ do { \ do { \ (Proc)->arity = 1; \ (Proc)->def_arg_reg[0] = (Eterm) (A0); \ - (Proc)->def_arg_reg[3] = (Eterm) ((Trap)->address); \ + *((UWord *) (UWord) ((Proc)->def_arg_reg + 3)) = (UWord) ((Trap)->address); \ + (Proc)->def_arg_reg[3] = (UWord) ((Trap)->address); \ (Proc)->freason = TRAP; \ (Ret) = THE_NON_VALUE; \ } while (0) @@ -144,7 +145,8 @@ do { \ (Proc)->arity = 2; \ (Proc)->def_arg_reg[0] = (Eterm) (A0); \ (Proc)->def_arg_reg[1] = (Eterm) (A1); \ - (Proc)->def_arg_reg[3] = (Eterm) ((Trap)->address); \ + *((UWord *) (UWord) ((Proc)->def_arg_reg + 3)) = (UWord) ((Trap)->address); \ + (Proc)->def_arg_reg[3] = (UWord) ((Trap)->address); \ (Proc)->freason = TRAP; \ (Ret) = THE_NON_VALUE; \ } while (0) @@ -155,14 +157,15 @@ do { \ (Proc)->def_arg_reg[0] = (Eterm) (A0); \ (Proc)->def_arg_reg[1] = (Eterm) (A1); \ (Proc)->def_arg_reg[2] = (Eterm) (A2); \ - (Proc)->def_arg_reg[3] = (Eterm) ((Trap)->address); \ + *((UWord *) (UWord) ((Proc)->def_arg_reg + 3)) = (UWord) ((Trap)->address); \ + (Proc)->def_arg_reg[3] = (UWord) ((Trap)->address); \ (Proc)->freason = TRAP; \ (Ret) = THE_NON_VALUE; \ } while (0) #define BIF_TRAP0(p, Trap_) do { \ (p)->arity = 0; \ - (p)->def_arg_reg[3] = (Eterm) ((Trap_)->address); \ + *((UWord *) (UWord) ((p)->def_arg_reg + 3)) = (UWord) ((Trap_)->address); \ (p)->freason = TRAP; \ return THE_NON_VALUE; \ } while(0) @@ -170,7 +173,7 @@ do { \ #define BIF_TRAP1(Trap_, p, A0) do { \ (p)->arity = 1; \ (p)->def_arg_reg[0] = (A0); \ - (p)->def_arg_reg[3] = (Eterm) ((Trap_)->address); \ + *((UWord *) (UWord) ((p)->def_arg_reg + 3)) = (UWord) ((Trap_)->address); \ (p)->freason = TRAP; \ return THE_NON_VALUE; \ } while(0) @@ -179,7 +182,7 @@ do { \ (p)->arity = 2; \ (p)->def_arg_reg[0] = (A0); \ (p)->def_arg_reg[1] = (A1); \ - (p)->def_arg_reg[3] = (Eterm) ((Trap_)->address); \ + *((UWord *) (UWord) ((p)->def_arg_reg + 3)) = (UWord) ((Trap_)->address); \ (p)->freason = TRAP; \ return THE_NON_VALUE; \ } while(0) @@ -189,14 +192,14 @@ do { \ (p)->def_arg_reg[0] = (A0); \ (p)->def_arg_reg[1] = (A1); \ (p)->def_arg_reg[2] = (A2); \ - (p)->def_arg_reg[3] = (Eterm) ((Trap_)->address); \ + *((UWord *) (UWord) ((p)->def_arg_reg + 3)) = (UWord) ((Trap_)->address); \ (p)->freason = TRAP; \ return THE_NON_VALUE; \ } while(0) #define BIF_TRAP_CODE_PTR_0(p, Code_) do { \ (p)->arity = 0; \ - (p)->def_arg_reg[3] = (Eterm) (Code_); \ + *((UWord *) (UWord) ((p)->def_arg_reg + 3)) = (UWord) (Code_); \ (p)->freason = TRAP; \ return THE_NON_VALUE; \ } while(0) |