Fix crash bug in array-style metadata query for nullary functions.

The shortcut way to construct an LLSD array of size n is to assign LLSD() to
array[n-1]. That's fine -- as long as you remember not to do it for n == 0.
meow-7.2.2
Nat Goodspeed 2011-01-31 22:58:56 -05:00
parent d6e9592329
commit 1fda496432
1 changed files with 2 additions and 1 deletions

View File

@ -443,7 +443,8 @@ struct LLEventDispatcher::ArrayParamsDispatchEntry: public LLEventDispatcher::Pa
{
LLSD array(LLSD::emptyArray());
// Resize to number of arguments required
array[mArity - 1] = LLSD();
if (mArity)
array[mArity - 1] = LLSD();
llassert_always(array.size() == mArity);
meta["required"] = array;
return meta;