Skip to content
Snippets Groups Projects
Commit 1fda4964 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

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.
parent d6e95923
No related branches found
No related tags found
No related merge requests found
...@@ -443,7 +443,8 @@ struct LLEventDispatcher::ArrayParamsDispatchEntry: public LLEventDispatcher::Pa ...@@ -443,7 +443,8 @@ struct LLEventDispatcher::ArrayParamsDispatchEntry: public LLEventDispatcher::Pa
{ {
LLSD array(LLSD::emptyArray()); LLSD array(LLSD::emptyArray());
// Resize to number of arguments required // Resize to number of arguments required
array[mArity - 1] = LLSD(); if (mArity)
array[mArity - 1] = LLSD();
llassert_always(array.size() == mArity); llassert_always(array.size() == mArity);
meta["required"] = array; meta["required"] = array;
return meta; return meta;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment