aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_unicode.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-11-26 14:14:22 +0100
committerPatrik Nyblom <[email protected]>2010-11-30 16:33:58 +0100
commit94eda4f777d79b159f0b6fd5ff5519649aa5affb (patch)
treea1acca65368d26076ea12945bbde812f1115800d /erts/emulator/beam/erl_unicode.c
parent561617f5ce8ac04e52ebb6cac2b131850a787869 (diff)
downloadotp-94eda4f777d79b159f0b6fd5ff5519649aa5affb.tar.gz
otp-94eda4f777d79b159f0b6fd5ff5519649aa5affb.tar.bz2
otp-94eda4f777d79b159f0b6fd5ff5519649aa5affb.zip
Teach prim_file not to accept atoms and not to throw exceptions
Diffstat (limited to 'erts/emulator/beam/erl_unicode.c')
-rw-r--r--erts/emulator/beam/erl_unicode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index 3434ce3979..72207df621 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -2429,6 +2429,13 @@ BIF_RETTYPE prim_file_internal_name2native_1(BIF_ALIST_1)
Sint need;
Eterm bin_term;
byte* bin_p;
+ /* Prim file explicitly does not allow atoms, although we could
+ very well cope with it. Instead of letting 'file' handle them,
+ it would probably be more efficient to handle them here. Subject to
+ change in R15. */
+ if (is_atom(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
if (is_binary(BIF_ARG_1)) {
byte *temp_alloc = NULL;
byte *bytes;