The Sun compiler points out that this code looks suspicious:
if (decoded_length < 0)
{
return Qnil;
XMALLOC_UNBIND (decoded, length * MAX_EMCHAR_LEN);
}
Also, here is a rewritten XMALLOC_OR_ALLOCA macro that avoids multiple
evaluation of the `len' argument.
#define XMALLOC_OR_ALLOCA(ptr, len, type) do { \
size_t XOA_len = (len); \
if (XOA_len > MAX_ALLOCA) \
{ \
(ptr) = (type *)xmalloc (XOA_len * sizeof (type)); \
speccount = specpdl_depth (); \
record_unwind_protect (free_malloced_ptr, \
make_opaque_ptr ((void *)ptr)); \
} \
else \
(ptr) = alloca_array (type, XOA_len); \
} while (0)
Martin