aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_bif_binary.c')
-rw-r--r--erts/emulator/beam/erl_bif_binary.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index cba17ee6eb..0a40e28474 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -1365,16 +1365,12 @@ static BIF_RETTYPE binary_match_trap(BIF_ALIST_3)
Eterm result;
Binary *bin = ((ProcBin *) binary_val(BIF_ARG_3))->val;
runres = do_binary_match(BIF_P,BIF_ARG_1,0,0,NIL,bin,BIF_ARG_2,&result);
- switch (runres) {
- case DO_BIN_MATCH_OK:
+ if (runres == DO_BIN_MATCH_OK) {
BIF_RET(result);
- case DO_BIN_MATCH_RESTART:
+ } else {
BUMP_ALL_REDS(BIF_P);
BIF_TRAP3(&binary_match_trap_export, BIF_P, BIF_ARG_1, result,
BIF_ARG_3);
- default:
- /* Cannot badarg in the trap */
- erl_exit(1, "Internal error in binary_match_trap.");
}
}
@@ -1384,20 +1380,15 @@ static BIF_RETTYPE binary_matches_trap(BIF_ALIST_3)
Eterm result;
Binary *bin = ((ProcBin *) binary_val(BIF_ARG_3))->val;
runres = do_binary_matches(BIF_P,BIF_ARG_1,0,0,NIL,bin,BIF_ARG_2,&result);
- switch (runres) {
- case DO_BIN_MATCH_OK:
+ if (runres == DO_BIN_MATCH_OK) {
BIF_RET(result);
- case DO_BIN_MATCH_RESTART:
+ } else {
BUMP_ALL_REDS(BIF_P);
BIF_TRAP3(&binary_matches_trap_export, BIF_P, BIF_ARG_1, result,
BIF_ARG_3);
- default:
- /* Cannot badarg in the trap */
- erl_exit(1, "Internal error in binary_matches_trap.");
}
}
-
BIF_RETTYPE binary_match_3(BIF_ALIST_3)
{
Uint hsstart;