Bug in erl_term_len()

Viktor Pracht ViktorPracht@REDACTED
Tue Jun 21 17:37:22 CEST 2005


Hello

The erl_interface function erl_term_len() reports a wrong size for functions
with parameters (it doesn't count the byte that specifies the arity). Here's
a patch:

--- erl_marshal(original).c	2005-04-07 08:11:42.000000000 +0200
+++ erl_marshal.c	2005-06-21 17:08:31.808018328 +0200
@@ -545,7 +545,7 @@
 	  for (i = 0; i < ERL_CLOSURE_SIZE(ep); i++)
 	      len += erl_term_len_helper(ERL_CLOSURE_ELEMENT(ep,i), dist);
       } else {
-	  len = 1 + 4 + 16 + 4 + 4;
+	  len = 1 + 1 + 4 + 16 + 4 + 4;
 	  len += erl_term_len_helper(ERL_FUN_MODULE(ep),dist);
 	  len += erl_term_len_helper(ERL_FUN_INDEX(ep),dist);
 	  len += erl_term_len_helper(ERL_FUN_UNIQ(ep),dist);



- Viktor Pracht

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++



More information about the erlang-patches mailing list