diff options
author | Erlang/OTP <[email protected]> | 2010-06-08 13:46:42 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-08 13:46:42 +0200 |
commit | 207dee6794b554af9d78336b1f1b5ccc11ee9ba1 (patch) | |
tree | 5b6e8232129cacec742470c145f6e7045388cbe9 /erts/emulator/beam/bif.c | |
parent | cc362ea3985f3d5f20d8f5316059c5ede04e6851 (diff) | |
parent | 4b928be53fa903f091230f19b1fd7374eb096edf (diff) | |
download | otp-207dee6794b554af9d78336b1f1b5ccc11ee9ba1.tar.gz otp-207dee6794b554af9d78336b1f1b5ccc11ee9ba1.tar.bz2 otp-207dee6794b554af9d78336b1f1b5ccc11ee9ba1.zip |
Merge branch 'bg/nif_error' into dev
* commit 'bg/nif_error':
crypto: Add type specs for all documented functions
crypto: Use erlang:nif_error/1 to squelch false Dialyzer warnings
Add erlang:nif_error/1,2
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r-- | erts/emulator/beam/bif.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 10cc2e9003..506bf383ca 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -1132,6 +1132,34 @@ BIF_RETTYPE error_2(Process* p, Eterm value, Eterm args) } /**********************************************************************/ +/* + * This is like exactly like error/1. The only difference is + * that Dialyzer thinks that it it will return an arbitrary term. + * It is useful in stub functions for NIFs. + */ + +BIF_RETTYPE nif_error_1(Process* p, Eterm term) +{ + p->fvalue = term; + BIF_ERROR(p, EXC_ERROR); +} + +/**********************************************************************/ +/* + * This is like exactly like error/2. The only difference is + * that Dialyzer thinks that it it will return an arbitrary term. + * It is useful in stub functions for NIFs. + */ + +BIF_RETTYPE nif_error_2(Process* p, Eterm value, Eterm args) +{ + Eterm* hp = HAlloc(p, 3); + + p->fvalue = TUPLE2(hp, value, args); + BIF_ERROR(p, EXC_ERROR_2); +} + +/**********************************************************************/ /* this is like throw/1 except that we set freason to EXC_EXIT */ BIF_RETTYPE exit_1(BIF_ALIST_1) |