File 0170-erts-Make-apply-throw-badarg-if-Args-is-not-a-list.patch of Package erlang

From 86bcdcb3db79ac2d1faa387bbe194924e966dd69 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Tue, 27 Jun 2017 17:08:26 +0200
Subject: [PATCH] erts: Make apply throw 'badarg' if Args is not a list

instead of a strange 'undef' exception.
---
 erts/emulator/beam/beam_emu.c    |  2 +-
 erts/emulator/test/fun_SUITE.erl | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 79d751d13..bc8369995 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -6829,7 +6829,7 @@ apply_fun(Process* p, Eterm fun, Eterm args, Eterm* reg)
     }
 
     if (is_not_nil(tmp)) {	/* Must be well-formed list */
-	p->freason = EXC_UNDEF;
+	p->freason = EXC_BADARG;
 	return NULL;
     }
     reg[arity] = fun;
-- 
2.13.2

openSUSE Build Service is sponsored by