From e588d1f28419745ee1e1ee98dc1852e0364a4088 Mon Sep 17 00:00:00 2001 From: Christian Goetze Date: Wed, 1 Jul 2009 00:22:05 +0000 Subject: svn merge -r125825:125901 svn+ssh://svn.lindenlab.com/svn/user/cg/qar-1654 QAR-1654 merge completed. --- indra/lscript/lscript_byteformat.h | 2 +- indra/lscript/lscript_compile/lscript_tree.cpp | 29 +++-- indra/lscript/lscript_compile/lscript_tree.h | 1 + indra/lscript/lscript_execute.h | 3 +- indra/lscript/lscript_execute/lscript_execute.cpp | 122 +++++++--------------- 5 files changed, 62 insertions(+), 95 deletions(-) (limited to 'indra/lscript') diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h index ba2c46bef2..a54ebd5831 100644 --- a/indra/lscript/lscript_byteformat.h +++ b/indra/lscript/lscript_byteformat.h @@ -556,7 +556,7 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] = // http_request string constants extern const char* URL_REQUEST_GRANTED; extern const char* URL_REQUEST_DENIED; -extern const U64 LSL_HTTP_REQUEST_TIMEOUT; +extern const U64 LSL_HTTP_REQUEST_TIMEOUT_USEC; #endif diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index e291d4c6f8..a15f1fee11 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -631,9 +631,7 @@ static void print_cil_cast(LLFILE* fp, LSCRIPTType srcType, LSCRIPTType targetTy switch(targetType) { case LST_INTEGER: - //fprintf(fp, "call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)\n"); - fprintf(fp, "conv.i4\n"); // TODO replace this line with the above - // we the entire grid is > 1.25.1 + fprintf(fp, "call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)\n"); break; case LST_STRING: fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n"); @@ -8375,10 +8373,18 @@ void LLScriptStateChange::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTComp chunk->addInteger(mIdentifier->mScopeEntry->mCount); } break; + case LSCP_TYPE: + mReturnType = basetype; + break; case LSCP_EMIT_CIL_ASSEMBLY: fprintf(fp, "ldarg.0\n"); fprintf(fp, "ldstr \"%s\"\n", mIdentifier->mName); fprintf(fp, "call instance void class [LslUserScript]LindenLab.SecondLife.LslUserScript::ChangeState(string)\n"); + // We are doing a state change. In the LSL interpreter, this is basically a longjmp. We emulate it + // here using a call to the ChangeState followed by a short cut return of the current method. To + // maintain type safety we need to push an arbitrary variable of the current method's return type + // onto the stack before returning. This will be ignored and discarded. + print_cil_init_variable(fp, mReturnType); fprintf(fp, "ret\n"); break; default: @@ -8793,7 +8799,8 @@ void LLScriptIf::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass p } break; case LSCP_PRUNE: - prunearg = FALSE; + prunearg = TRUE; + mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); break; case LSCP_TYPE: mExpression->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -8979,7 +8986,8 @@ void LLScriptFor::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass } break; case LSCP_PRUNE: - prunearg = FALSE; + prunearg = TRUE; + mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); break; case LSCP_TYPE: if(mSequence) @@ -9083,7 +9091,8 @@ void LLScriptDoWhile::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompileP } break; case LSCP_PRUNE: - prunearg = FALSE; + prunearg = TRUE; + mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); break; case LSCP_TYPE: mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -9159,7 +9168,8 @@ void LLScriptWhile::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas } break; case LSCP_PRUNE: - prunearg = FALSE; + prunearg = TRUE; + mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); break; case LSCP_TYPE: mExpression->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -10127,7 +10137,10 @@ void LLScriptGlobalFunctions::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPT mStatements->recurse(fp, tabs, tabsize, pass, LSPRUNE_GLOBAL_NON_VOIDS, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); if (!prunearg) { - gErrorToText.writeError(fp, this, LSERROR_NO_RETURN); + if (!gErrorToText.getErrors()) // Hide this error when a state change has been made in a global function + { + gErrorToText.writeError(fp, this, LSERROR_NO_RETURN); + } } } else diff --git a/indra/lscript/lscript_compile/lscript_tree.h b/indra/lscript/lscript_compile/lscript_tree.h index 12c16908af..a667e1eb5b 100644 --- a/indra/lscript/lscript_compile/lscript_tree.h +++ b/indra/lscript/lscript_compile/lscript_tree.h @@ -1888,6 +1888,7 @@ public: S32 getSize(); LLScriptIdentifier *mIdentifier; + LSCRIPTType mReturnType; }; class LLScriptJump : public LLScriptStatement diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h index 9a631c4c8f..8549482299 100644 --- a/indra/lscript/lscript_execute.h +++ b/indra/lscript/lscript_execute.h @@ -369,8 +369,7 @@ class LLScriptExecute { public: LLScriptExecute(); - virtual ~LLScriptExecute() {;} - + virtual ~LLScriptExecute() = 0; virtual S32 getVersion() const = 0; virtual void deleteAllEvents() = 0; virtual void addEvent(LLScriptDataCollection* event) = 0; diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index 05fee9a419..1f908eb675 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -41,6 +41,8 @@ #include "lscript_library.h" #include "lscript_heapruntime.h" #include "lscript_alloc.h" +#include "llstat.h" + // Static const S32 DEFAULT_SCRIPT_TIMER_CHECK_SKIP = 4; @@ -72,7 +74,7 @@ const char* URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; const char* URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; // HTTP Requests to LSL scripts will time out after 25 seconds. -const U64 LSL_HTTP_REQUEST_TIMEOUT = 25 * USEC_PER_SEC; +const U64 LSL_HTTP_REQUEST_TIMEOUT_USEC = 25 * USEC_PER_SEC; LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp) { @@ -110,6 +112,7 @@ LLScriptExecuteLSL2::LLScriptExecuteLSL2(const U8* bytecode, U32 bytecode_size) init(); } +LLScriptExecute::~LLScriptExecute() {} LLScriptExecuteLSL2::~LLScriptExecuteLSL2() { delete[] mBuffer; @@ -4234,19 +4237,16 @@ S32 lscript_push_variable(LLScriptLibData *data, U8 *buffer) return 4; } -BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) + +// Shared code for run_calllib() and run_calllib_two_byte() +BOOL run_calllib_common(U8 *buffer, S32 &offset, const LLUUID &id, U16 arg) { - if (b_print) - printf("[0x%X]\tCALLLIB ", offset); - offset++; - U8 arg = safe_instruction_bytestream2byte(buffer, offset); if (arg >= gScriptLibrary.mNextNumber) { set_fault(buffer, LSRF_BOUND_CHECK_ERROR); return FALSE; } - if (b_print) - printf("%d (%s)\n", (U32)arg, gScriptLibrary.mFunctions[arg]->mName); + LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; // pull out the arguments and the return values LLScriptLibData *arguments = NULL; @@ -4254,14 +4254,14 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) S32 i, number; - if (gScriptLibrary.mFunctions[arg]->mReturnType) + if (function->mReturnType) { returnvalue = new LLScriptLibData; } - if (gScriptLibrary.mFunctions[arg]->mArgs) + if (function->mArgs) { - number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/ + number = (S32)strlen(function->mArgs); //Flawfinder: ignore arguments = new LLScriptLibData[number]; } else @@ -4271,24 +4271,18 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) for (i = number - 1; i >= 0; i--) { - lscript_pop_variable(&arguments[i], buffer, gScriptLibrary.mFunctions[arg]->mArgs[i]); + lscript_pop_variable(&arguments[i], buffer, function->mArgs[i]); } - if (b_print) - { - printf("%s\n", gScriptLibrary.mFunctions[arg]->mDesc); - } + // Actually execute the function call + function->mExecFunc(returnvalue, arguments, id); - { - // LLFastTimer time_in_libraries1(LLFastTimer::FTM_TEMP7); - gScriptLibrary.mFunctions[arg]->mExecFunc(returnvalue, arguments, id); - } - add_register_fp(buffer, LREG_ESR, -gScriptLibrary.mFunctions[arg]->mEnergyUse); - add_register_fp(buffer, LREG_SLR, gScriptLibrary.mFunctions[arg]->mSleepTime); + add_register_fp(buffer, LREG_ESR, -(function->mEnergyUse)); + add_register_fp(buffer, LREG_SLR, function->mSleepTime); if (returnvalue) { - returnvalue->mType = char2type(*gScriptLibrary.mFunctions[arg]->mReturnType); + returnvalue->mType = char2type(*function->mReturnType); lscript_push_return_variable(returnvalue, buffer); } @@ -4305,72 +4299,32 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) } -BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) +BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) { - if (b_print) - printf("[0x%X]\tCALLLIB ", offset); offset++; - U16 arg = safe_instruction_bytestream2u16(buffer, offset); - if (arg >= gScriptLibrary.mNextNumber) - { - set_fault(buffer, LSRF_BOUND_CHECK_ERROR); - return FALSE; - } - if (b_print) - printf("%d (%s)\n", (U32)arg, gScriptLibrary.mFunctions[arg]->mName); - - // pull out the arguments and the return values - LLScriptLibData *arguments = NULL; - LLScriptLibData *returnvalue = NULL; - - S32 i, number; - - if (gScriptLibrary.mFunctions[arg]->mReturnType) - { - returnvalue = new LLScriptLibData; - } - - if (gScriptLibrary.mFunctions[arg]->mArgs) + U16 arg = (U16) safe_instruction_bytestream2byte(buffer, offset); + if (b_print && + arg < gScriptLibrary.mNextNumber) { - number = (S32)strlen(gScriptLibrary.mFunctions[arg]->mArgs); /*Flawfinder: ignore*/ - arguments = new LLScriptLibData[number]; - } - else - { - number = 0; - } - - for (i = number - 1; i >= 0; i--) - { - lscript_pop_variable(&arguments[i], buffer, gScriptLibrary.mFunctions[arg]->mArgs[i]); - } - - if (b_print) - { - printf("%s\n", gScriptLibrary.mFunctions[arg]->mDesc); - } - - { - // LLFastTimer time_in_libraries2(LLFastTimer::FTM_TEMP8); - gScriptLibrary.mFunctions[arg]->mExecFunc(returnvalue, arguments, id); + printf("[0x%X]\tCALLLIB ", offset); + LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; + printf("%d (%s)\n", (U32)arg, function->mName); + printf("%s\n", function->mDesc); } - add_register_fp(buffer, LREG_ESR, -gScriptLibrary.mFunctions[arg]->mEnergyUse); - add_register_fp(buffer, LREG_SLR, gScriptLibrary.mFunctions[arg]->mSleepTime); + return run_calllib_common(buffer, offset, id, arg); +} - if (returnvalue) +BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) +{ + offset++; + U16 arg = safe_instruction_bytestream2u16(buffer, offset); + if (b_print && + arg < gScriptLibrary.mNextNumber) { - returnvalue->mType = char2type(*gScriptLibrary.mFunctions[arg]->mReturnType); - lscript_push_return_variable(returnvalue, buffer); + printf("[0x%X]\tCALLLIB ", (offset-1)); + LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; + printf("%d (%s)\n", (U32)arg, function->mName); + printf("%s\n", function->mDesc); } - - delete [] arguments; - delete returnvalue; - - // reset the BP after calling the library files - S32 bp = lscript_pop_int(buffer); - set_bp(buffer, bp); - - // pop off the spot for the instruction pointer - lscript_poparg(buffer, 4); - return FALSE; + return run_calllib_common(buffer, offset, id, arg); } -- cgit v1.3 From d025b721e0d39f53ef796f9c9e28e94b6d1cea20 Mon Sep 17 00:00:00 2001 From: Christian Goetze Date: Wed, 15 Jul 2009 17:55:58 +0000 Subject: svn merge -r126867:127217 svn+ssh://svn.lindenlab.com/svn/user/cg/qar-1691 Effective merge: svn merge -r125827:127126 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.27 QAR-1691 --- indra/llmessage/lliohttpserver.cpp | 14 +++++++--- indra/llmessage/llxfermanager.cpp | 36 +++++++++++++++----------- indra/llprimitive/llprimtexturelist.cpp | 5 ++-- indra/lscript/lscript_compile/lscript_tree.cpp | 17 ++++-------- 4 files changed, 38 insertions(+), 34 deletions(-) (limited to 'indra/lscript') diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index 83dfa94f00..ce815cc85b 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -520,7 +520,7 @@ protected: * seek orfor string assignment. * @returns Returns true if a line was found. */ - bool readLine( + bool readHeaderLine( const LLChannelDescriptors& channels, buffer_ptr_t buffer, U8* dest, @@ -591,7 +591,7 @@ LLHTTPResponder::~LLHTTPResponder() //lldebugs << "destroying LLHTTPResponder" << llendl; } -bool LLHTTPResponder::readLine( +bool LLHTTPResponder::readHeaderLine( const LLChannelDescriptors& channels, buffer_ptr_t buffer, U8* dest, @@ -669,7 +669,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( #endif PUMP_DEBUG; - if(readLine(channels, buffer, (U8*)buf, len)) + if(readHeaderLine(channels, buffer, (U8*)buf, len)) { bool read_next_line = false; bool parse_all = true; @@ -733,7 +733,13 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( if(read_next_line) { len = HEADER_BUFFER_SIZE; - readLine(channels, buffer, (U8*)buf, len); + if (!readHeaderLine(channels, buffer, (U8*)buf, len)) + { + // Failed to read the header line, probably too long. + // readHeaderLine already marked the channel/buffer as bad. + keep_parsing = false; + break; + } } if(0 == len) { diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index 08c9192c9f..209bdb2249 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -760,30 +760,36 @@ static bool remove_prefix(std::string& filename, const std::string& prefix) static bool verify_cache_filename(const std::string& filename) { //NOTE: This routine is only used to check file names that our own - // code places in the cache directory. As such, it can be limited - // to this very restrictive file name pattern. It does not need to - // handle other characters. - + // code places in the cache directory. As such, it can be limited + // to this very restrictive file name pattern. It does not need to + // handle other characters. The only known uses of this are (with examples): + // sim to sim object pass: fc0b72d8-9456-63d9-a802-a557ef847313.tmp + // sim to viewer mute list: mute_b78eacd0-1244-448e-93ca-28ede242f647.tmp + // sim to viewer task inventory: inventory_d8ab59d2-baf0-0e79-c4c2-a3f99b9fcf45.tmp + + //IMPORTANT: Do not broaden the filenames accepted by this routine + // without careful analysis. Anything allowed by this function can + // be downloaded by the viewer. + size_t len = filename.size(); - //const boost::regex expr("[a-zA-Z0-9][-_.a-zA-Z0-9]<0,49>"); - if (len < 1 || len > 50) - { + //const boost::regex expr("[0-9a-zA-Z_-]<1,46>\.tmp"); + if (len < 5 || len > 50) + { return false; } - for(unsigned i=0; i 0) - { - ok = '_'==c || '-'==c || '.'==c; - } + bool ok = isalnum(c) || '_'==c || '-'==c; if (!ok) { return false; } } - return true; + return filename[len-4] == '.' + && filename[len-3] == 't' + && filename[len-2] == 'm' + && filename[len-1] == 'p'; } void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user_data*/) diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index c1dde32993..b02d4c50bd 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -134,13 +134,12 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) { if (S32(index) >= mEntryList.size()) { - // TODO -- assert here S32 current_size = mEntryList.size(); - llerrs << "index = " << S32(index) << " current_size = " << current_size << llendl; + llwarns << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << llendl; return TEM_CHANGE_NONE; } - // we're changing an existing entry + // we're changing an existing entry llassert(mEntryList[index]); delete (mEntryList[index]); if (&te) diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index a15f1fee11..7fa115bb20 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -8799,8 +8799,7 @@ void LLScriptIf::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass p } break; case LSCP_PRUNE: - prunearg = TRUE; - mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + prunearg = FALSE; break; case LSCP_TYPE: mExpression->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -8986,8 +8985,7 @@ void LLScriptFor::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass } break; case LSCP_PRUNE: - prunearg = TRUE; - mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + prunearg = FALSE; break; case LSCP_TYPE: if(mSequence) @@ -9091,8 +9089,7 @@ void LLScriptDoWhile::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompileP } break; case LSCP_PRUNE: - prunearg = TRUE; - mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + prunearg = FALSE; break; case LSCP_TYPE: mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -9168,8 +9165,7 @@ void LLScriptWhile::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePas } break; case LSCP_PRUNE: - prunearg = TRUE; - mStatement->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); + prunearg = FALSE; break; case LSCP_TYPE: mExpression->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); @@ -10137,10 +10133,7 @@ void LLScriptGlobalFunctions::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPT mStatements->recurse(fp, tabs, tabsize, pass, LSPRUNE_GLOBAL_NON_VOIDS, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL); if (!prunearg) { - if (!gErrorToText.getErrors()) // Hide this error when a state change has been made in a global function - { - gErrorToText.writeError(fp, this, LSERROR_NO_RETURN); - } + gErrorToText.writeError(fp, this, LSERROR_NO_RETURN); } } else -- cgit v1.3 From 0f0853a6fe23c6eb4341d6a5a0752e224cdf1b22 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 1 Sep 2009 18:16:04 -0400 Subject: Fix up some more post-merge breakage. --- indra/llprimitive/llprimitive.cpp | 2 +- indra/lscript/lscript_execute/lscript_execute.cpp | 36 +++++++++++------------ indra/newview/llviewermessage.cpp | 3 +- indra/newview/llvoiceclient.cpp | 4 +-- 4 files changed, 22 insertions(+), 23 deletions(-) (limited to 'indra/lscript') diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 2177f5c365..dcfb5cfae6 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1902,7 +1902,7 @@ bool LLLightImageParams::fromLLSD(LLSD& sd) if (sd.has("texture")) { setLightTexture( sd["texture"] ); - setParams( sd["params"] ); + setParams( LLVector3( sd["params"] ) ); return true; } diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index 1f908eb675..e849fa9a6e 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -4241,12 +4241,12 @@ S32 lscript_push_variable(LLScriptLibData *data, U8 *buffer) // Shared code for run_calllib() and run_calllib_two_byte() BOOL run_calllib_common(U8 *buffer, S32 &offset, const LLUUID &id, U16 arg) { - if (arg >= gScriptLibrary.mNextNumber) + if (arg >= gScriptLibrary.mFunctions.size()) { set_fault(buffer, LSRF_BOUND_CHECK_ERROR); return FALSE; } - LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; + LLScriptLibraryFunction const & function = gScriptLibrary.mFunctions[arg]; // pull out the arguments and the return values LLScriptLibData *arguments = NULL; @@ -4254,14 +4254,14 @@ BOOL run_calllib_common(U8 *buffer, S32 &offset, const LLUUID &id, U16 arg) S32 i, number; - if (function->mReturnType) + if (function.mReturnType) { returnvalue = new LLScriptLibData; } - if (function->mArgs) + if (function.mArgs) { - number = (S32)strlen(function->mArgs); //Flawfinder: ignore + number = (S32)strlen(function.mArgs); //Flawfinder: ignore arguments = new LLScriptLibData[number]; } else @@ -4271,18 +4271,18 @@ BOOL run_calllib_common(U8 *buffer, S32 &offset, const LLUUID &id, U16 arg) for (i = number - 1; i >= 0; i--) { - lscript_pop_variable(&arguments[i], buffer, function->mArgs[i]); + lscript_pop_variable(&arguments[i], buffer, function.mArgs[i]); } // Actually execute the function call - function->mExecFunc(returnvalue, arguments, id); + function.mExecFunc(returnvalue, arguments, id); - add_register_fp(buffer, LREG_ESR, -(function->mEnergyUse)); - add_register_fp(buffer, LREG_SLR, function->mSleepTime); + add_register_fp(buffer, LREG_ESR, -(function.mEnergyUse)); + add_register_fp(buffer, LREG_SLR, function.mSleepTime); if (returnvalue) { - returnvalue->mType = char2type(*function->mReturnType); + returnvalue->mType = char2type(*function.mReturnType); lscript_push_return_variable(returnvalue, buffer); } @@ -4304,12 +4304,12 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) offset++; U16 arg = (U16) safe_instruction_bytestream2byte(buffer, offset); if (b_print && - arg < gScriptLibrary.mNextNumber) + arg < gScriptLibrary.mFunctions.size()) { printf("[0x%X]\tCALLLIB ", offset); - LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; - printf("%d (%s)\n", (U32)arg, function->mName); - printf("%s\n", function->mDesc); + LLScriptLibraryFunction const & function = gScriptLibrary.mFunctions[arg]; + printf("%d (%s)\n", (U32)arg, function.mName); + //printf("%s\n", function.mDesc); } return run_calllib_common(buffer, offset, id, arg); } @@ -4319,12 +4319,12 @@ BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &i offset++; U16 arg = safe_instruction_bytestream2u16(buffer, offset); if (b_print && - arg < gScriptLibrary.mNextNumber) + arg < gScriptLibrary.mFunctions.size()) { printf("[0x%X]\tCALLLIB ", (offset-1)); - LLScriptLibraryFunction *function = gScriptLibrary.mFunctions[arg]; - printf("%d (%s)\n", (U32)arg, function->mName); - printf("%s\n", function->mDesc); + LLScriptLibraryFunction const & function = gScriptLibrary.mFunctions[arg]; + printf("%d (%s)\n", (U32)arg, function.mName); + //printf("%s\n", function.mDesc); } return run_calllib_common(buffer, offset, id, arg); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 28e20d92d0..111cdf7c12 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5590,9 +5590,8 @@ void process_covenant_reply(LLMessageSystem* msg, void**) LLPanelLandCovenant::updateLastModified(last_modified); LLFloaterBuyLand::updateLastModified(last_modified); - gCacheName->get(estate_owner_id, false, &callbackCacheEstateOwnerName); BOOL is_group = FALSE; - gCacheName->getNameFromUUID(estate_owner_id, is_group, callbackCacheEstateOwnerName); + gCacheName->get(estate_owner_id, is_group, &callbackCacheEstateOwnerName); // load the actual covenant asset data const BOOL high_priority = TRUE; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 182850f326..746dc99e35 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -6920,8 +6920,8 @@ void LLVoiceClient::notifyFriendObservers() void LLVoiceClient::lookupName(const LLUUID &id) { - gCacheName->get(id, FALSE, &LLVoiceClient::onAvatarNameLookup); - gCacheName->getNameFromUUID(id, is_group, onAvatarNameLookup); + BOOL is_group = FALSE; + gCacheName->get(id, is_group, &LLVoiceClient::onAvatarNameLookup); } //static -- cgit v1.3