aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-08-16 11:37:54 +0200
committerPatrik Nyblom <[email protected]>2013-08-16 11:37:54 +0200
commit5d9a587a8fcc164e02f043959338edec2ff69381 (patch)
tree554f05a944777622b30031724010f6f31707565b /erts/emulator/beam/utils.c
parent23610dbfc1c409f83349e9e293dd3cfc1f74d497 (diff)
parent52cb62b7930d9c7b9e04a210ff6b02946f27ae79 (diff)
downloadotp-5d9a587a8fcc164e02f043959338edec2ff69381.tar.gz
otp-5d9a587a8fcc164e02f043959338edec2ff69381.tar.bz2
otp-5d9a587a8fcc164e02f043959338edec2ff69381.zip
Merge branch 'pan/update_pcre_8.33'
* pan/update_pcre_8.33: Workaround TR gnu/181328, GCC 4.2.1 20070831 on FreeBSD 9.1 Clarify relation between erts_iolist_{size|to_buf} Fix backslash in titles of manpages Correct UTF-8 in stdlib's notes.xml Add more tests for corner error cases in erl_bif_re.c Add documentation of report_errors and match_limit(_recursion) Add match_limit and match_limit_recursion options Add return_errors option to re:run/3 Add README for updating PCRE Add documentation of extensions to re module Add new options to Erlang re interface and mend dupnames Update PCRE doc part of re.xml to PCRE 8.33 state Integrate new PCRE test suites Integrate patch for PCRE bug id 1370 Handle CRLF correctly in global regexp Add erts_prefix to pcre_library and update erl_bif_re Update to PCRE 8.33, w/o the erts_ prefix added OTP-11204 OTP-11205 OTP-10285
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index bd2be7afca..c71f8f0712 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -3021,6 +3021,14 @@ buf_to_intlist(Eterm** hpp, const char *buf, size_t len, Eterm tail)
** Return remaining bytes in buffer on success
** ERTS_IOLIST_TO_BUF_OVERFLOW on overflow
** ERTS_IOLIST_TO_BUF_TYPE_ERROR on type error (including that result would not be a whole number of bytes)
+**
+** Note!
+** Do not detect indata errors in this fiunction that are not detected by erts_iolist_size!
+**
+** A caller should be able to rely on a successful return from erts_iolist_to_buf
+** if erts_iolist_size is previously successfully called and erts_iolist_to_buf
+** is called with a buffer at least as large as the value given by erts_iolist_size.
+**
*/
ErlDrvSizeT erts_iolist_to_buf(Eterm obj, char* buf, ErlDrvSizeT alloced_len)
@@ -3127,6 +3135,11 @@ ErlDrvSizeT erts_iolist_to_buf(Eterm obj, char* buf, ErlDrvSizeT alloced_len)
/*
* Return 0 if successful, and non-zero if unsuccessful.
+ *
+ * It is vital that if erts_iolist_to_buf would return an error for
+ * any type of term data, this function should do so as well.
+ * Any input term error detected in erts_iolist_to_buf should also
+ * be detected in this function!
*/
int erts_iolist_size(Eterm obj, ErlDrvSizeT* sizep)
{