From af0bfb388a4ecd2a2c67ae18743c9c63ca3fd29e Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:33:26 +0000 Subject: CID-132 Checker: NULL_RETURNS Function: LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory *) File: /indra/newview/llpanellandmarkinfo.cpp --- indra/newview/llpanellandmarkinfo.cpp | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index cd6c727b5c..56d52ccc65 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -376,21 +376,31 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) // static std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat) { - std::string name = cat->getName(); + std::string name; LLUUID parent_id; - // translate category name, if it's right below the root - // FIXME: it can throw notification about non existent string in strings.xml - if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID()) + llassert(cat); + if (cat) { - LLTrans::findString(name, "InvFolder " + name); - } + name = cat->getName(); - // we don't want "My Inventory" to appear in the name - while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID()) - { - cat = gInventory.getCategory(parent_id); - name = cat->getName() + "/" + name; + // translate category name, if it's right below the root + // FIXME: it can throw notification about non existent string in strings.xml + if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID()) + { + LLTrans::findString(name, "InvFolder " + name); + } + + // we don't want "My Inventory" to appear in the name + while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID()) + { + cat = gInventory.getCategory(parent_id); + llassert(cat); + if (cat) + { + name = cat->getName() + "/" + name; + } + } } return name; -- cgit v1.2.3 From 86056788ec8a5af023c6b8d7d0809597bc1012f0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:35:53 +0000 Subject: CID-134 Checker: NULL_RETURNS Function: LLToolsEnableUnlink::handleEvent(const LLSD &) File: /indra/newview/llviewermenu.cpp --- indra/newview/llviewermenu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b15a9a9e99..8c61ba7558 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4842,9 +4842,10 @@ class LLToolsEnableUnlink : public view_listener_t { bool handleEvent(const LLSD& userdata) { + LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject(); bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && - LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && - !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment(); + first_editable_object && + !first_editable_object->isAttachment(); return new_value; } }; -- cgit v1.2.3 From eb140739dbc26a0331b16b12081f1dae3847c9bb Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:37:08 +0000 Subject: CID-138 Checker: NULL_RETURNS Function: LLPanelFace::sendGlow() File: /indra/newview/llpanelface.cpp --- indra/newview/llpanelface.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 8c5208678e..4f450ce0a8 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -265,10 +265,13 @@ void LLPanelFace::sendAlpha() void LLPanelFace::sendGlow() { - LLSpinCtrl* mCtrlGlow = getChild("glow"); - F32 glow = mCtrlGlow->get(); - - LLSelectMgr::getInstance()->selectionSetGlow( glow ); + LLSpinCtrl* mCtrlGlow = getChild("glow"); + llassert(mCtrlGlow); + if (mCtrlGlow) + { + F32 glow = mCtrlGlow->get(); + LLSelectMgr::getInstance()->selectionSetGlow( glow ); + } } struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor -- cgit v1.2.3 From 10c9f17301e2dbacb0105b29d7214e67d5de8e85 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:40:45 +0000 Subject: CID-139 Checker: NULL_RETURNS Function: LLPanelFaceSetTEFunctor::apply(LLViewerObject *, int) File: /indra/newview/llpanelface.cpp --- indra/newview/llpanelface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 4f450ce0a8..b50c6442e1 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -289,6 +289,9 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild("checkbox flip s"); LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild("checkbox flip t"); LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); + llassert(comboTexGen); + llassert(object); + if (ctrlTexScaleS) { valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative(); @@ -299,7 +302,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { value = -value; } - if (comboTexGen->getCurrentIndex() == 1) + if (comboTexGen && + comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -317,7 +321,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { value = -value; } - if (comboTexGen->getCurrentIndex() == 1) + if (comboTexGen && + comboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } -- cgit v1.2.3 From 0cf46fe136d23781e71e092eaed89163647c98a3 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:43:33 +0000 Subject: CID-144 Checker: NULL_RETURNS Function: LLInvFVBridgeAction::doAction(const LLUUID &, LLInventoryModel *) File: /indra/newview/llinventorybridge.cpp --- indra/newview/llinventorybridge.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 019a4b22c3..ec2be0e8e9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5096,12 +5096,18 @@ void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, //static void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model) { - LLAssetType::EType asset_type = model->getItem(uuid)->getType(); - LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); - if(action) + llassert(model); + LLViewerInventoryItem* item = model->getItem(uuid); + llassert(item); + if (item) { - action->doIt(); - delete action; + LLAssetType::EType asset_type = item->getType(); + LLInvFVBridgeAction* action = createAction(asset_type,uuid,model); + if(action) + { + action->doIt(); + delete action; + } } } -- cgit v1.2.3 From 51e2ee7b3a9d8a4a10373edd1ee99e7ee25e8a38 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:45:28 +0000 Subject: CID-145 Checker: NULL_RETURNS File: /indra/llui/llscrolllistctrl.cpp --- indra/newview/llfloatertopobjects.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index c930e99bad..8ab050beaa 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -283,8 +283,13 @@ void LLFloaterTopObjects::updateSelectionInfo() std::string object_id_string = object_id.asString(); childSetValue("id_editor", LLSD(object_id_string)); - childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getValue().asString()); - childSetValue("owner_name_editor", list->getFirstSelected()->getColumn(2)->getValue().asString()); + LLScrollListItem* sli = list->getFirstSelected(); + llassert(sli); + if (sli) + { + childSetValue("object_name_editor", sli->getColumn(1)->getValue().asString()); + childSetValue("owner_name_editor", sli->getColumn(2)->getValue().asString()); + } } // static -- cgit v1.2.3 From 710687ce6751dab6afec76b2bc2a4d03568e44ec Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 13:49:08 +0000 Subject: CID-208 Checker: REVERSE_INULL Function: LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup *) File: /indra/newview/llvovolume.cpp --- indra/newview/llvovolume.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 12728a2377..9fbcd1d32a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3494,7 +3494,8 @@ static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { llpushcallstacks ; - if (group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) + llassert(group); + if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { LLFastTimer tm(FTM_VOLUME_GEOM); S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ; @@ -3548,9 +3549,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) } // don't forget alpha - if( group != NULL && - !group->mVertexBuffer.isNull() && - group->mVertexBuffer->isLocked()) + if(group != NULL && + !group->mVertexBuffer.isNull() && + group->mVertexBuffer->isLocked()) { group->mVertexBuffer->setBuffer(0); } @@ -3576,7 +3577,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) group->clearState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO); } - if (group->isState(LLSpatialGroup::NEW_DRAWINFO)) + if (group && group->isState(LLSpatialGroup::NEW_DRAWINFO)) { llerrs << "WTF?" << llendl; } -- cgit v1.2.3 From 3ac37e9b896e19b6c7ba24aa038d49551c5add38 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:00:30 +0000 Subject: CID-211 Checker: REVERSE_INULL Function: LLChicletPanel::findChiclet(const LLUUID &) File: /indra/newview/llchiclet.h --- indra/newview/llchiclet.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index b006ae3420..ba17c5970e 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -1228,12 +1228,15 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id) { LLChiclet* chiclet = *it; + llassert(chiclet); + if (!chiclet) continue; if(chiclet->getSessionId() == im_session_id) { T* result = dynamic_cast(chiclet); - if(!result && chiclet) + if(!result) { llwarns << "Found chiclet but of wrong type " << llendl; + continue; } return result; } -- cgit v1.2.3 From 74ffa0fa480e57371acd992fce7f291f04456729 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:04:26 +0000 Subject: CID-207 Checker: REVERSE_INULL Function: LLInventoryModel::addItem(LLViewerInventoryItem *) File: /indra/newview/llinventorymodel.cpp --- indra/newview/llinventorymodel.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 7ec976604a..a6e8f07e21 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1937,23 +1937,25 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) { //llinfos << "LLInventoryModel::addItem()" << llendl; - // This can happen if assettype enums from llassettype.h ever change. - // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when - // the AT_LINK enum changed from 23 to 24. - if ((item->getType() == LLAssetType::AT_NONE) - || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) - { - llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl; - return; - } if(item) { + // This can happen if assettype enums from llassettype.h ever change. + // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when + // the AT_LINK enum changed from 23 to 24. + if ((item->getType() == LLAssetType::AT_NONE) + || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) + { + llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl; + return; + } + // This condition means that we tried to add a link without the baseobj being in memory. // The item will show up as a broken link. if (item->getIsBrokenLink()) { llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl; } + mItemMap[item->getUUID()] = item; } } -- cgit v1.2.3 From a0c57cbb824f5ec976f43a096c320929c7d89120 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:05:09 +0000 Subject: CID-207 assert. --- indra/newview/llinventorymodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a6e8f07e21..326f2a5577 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1937,6 +1937,7 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) { //llinfos << "LLInventoryModel::addItem()" << llendl; + llassert(item); if(item) { // This can happen if assettype enums from llassettype.h ever change. -- cgit v1.2.3 From cf69f03af17070152b5ca2772e7addfd0dcc4800 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:06:31 +0000 Subject: CID-206 Checker: REVERSE_INULL Function: LLMultiSliderCtrl::onEditorCommit(LLUICtrl *, const LLSD &) File: /indra/llui/llmultisliderctrl.cpp --- indra/llui/llmultisliderctrl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 50942e55ca..cc26c00a3e 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -330,13 +330,14 @@ void LLMultiSliderCtrl::updateText() // static void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata) { + llassert(ctrl); + if (!ctrl) + return; + LLMultiSliderCtrl* self = dynamic_cast(ctrl->getParent()); llassert(self); if (!self) // cast failed - wrong type! :O return; - - if (!ctrl) - return; BOOL success = FALSE; F32 val = self->mCurValue; -- cgit v1.2.3 From d7060eb323f7cfebb7576e2999f782e8617e40e8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:08:58 +0000 Subject: CID-205 Checker: REVERSE_INULL Function: LLPanel::fromXML(LLPointer, LLView *, LLPointer) File: /indra/llui/llpanel.cpp --- indra/llui/llpanel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 7b406e090a..d963cf4c98 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -397,6 +397,12 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_ if (!panelp) { panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name); + llassert(panelp); + + if (!panelp) + { + return NULL; // :( + } } } @@ -414,7 +420,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_ panelp->mCommitCallbackRegistrar.popScope(); panelp->mEnableCallbackRegistrar.popScope(); - if (panelp && !panelp->getFactoryMap().empty()) + if (!panelp->getFactoryMap().empty()) { LLUICtrlFactory::instance().popFactoryFunctions(); } -- cgit v1.2.3 From 1936b5769eaf7ee66c2ac55080dc45cf25f9a50a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:11:20 +0000 Subject: CID-204 Checker: REVERSE_INULL Function: LLXUIXSDWriter::writeXSD(const std::basic_string, std::allocator>&, const std::basic_string, std::allocator>&, const LLInitParam::BaseBlock &) File: /indra/llxuixml/llxuiparser.cpp --- indra/llxuixml/llxuiparser.cpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 17399865e5..705e7137c2 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -324,33 +324,34 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p // add includes for all possible children const std::type_info* type = *LLWidgetTypeRegistry::instance().getValue(type_name); const widget_registry_t* widget_registryp = LLChildRegistryRegistry::instance().getValue(type); - - // add include declarations for all valid children - for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems(); - it != widget_registryp->currentRegistrar().endItems(); - ++it) - { - std::string widget_name = it->first; - if (widget_name == type_name) - { - continue; - } - LLXMLNodePtr nodep = new LLXMLNode("xs:include", false); - nodep->createChild("schemaLocation", true)->setStringValue(widget_name + ".xsd"); - - // add to front of schema - mSchemaNode->addChild(nodep, mSchemaNode); - } + llassert(widget_registryp); // add choices for valid children if (widget_registryp) { + // add include declarations for all valid children + for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems(); + it != widget_registryp->currentRegistrar().endItems(); + ++it) + { + std::string widget_name = it->first; + if (widget_name == type_name) + { + continue; + } + LLXMLNodePtr nodep = new LLXMLNode("xs:include", false); + nodep->createChild("schemaLocation", true)->setStringValue(widget_name + ".xsd"); + + // add to front of schema + mSchemaNode->addChild(nodep, mSchemaNode); + } + for (widget_registry_t::Registrar::registry_map_t::const_iterator it = widget_registryp->currentRegistrar().beginItems(); it != widget_registryp->currentRegistrar().endItems(); ++it) { std::string widget_name = it->first; - // + // LLXMLNodePtr widget_node = mElementNode->createChild("xs:element", false); widget_node->createChild("name", true)->setStringValue(widget_name); widget_node->createChild("type", true)->setStringValue(widget_name); -- cgit v1.2.3 From eb1d043dafa86480757cc1ed934d96ba51033581 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:13:06 +0000 Subject: CID-203 Checker: REVERSE_INULL Function: LLTabContainer::addTabPanel(const LLTabContainer::TabPanelParams &) File: /indra/llui/lltabcontainer.cpp --- indra/llui/lltabcontainer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 13340e7ded..e810b6fe8f 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -891,6 +891,10 @@ void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabCon void LLTabContainer::addTabPanel(const TabPanelParams& panel) { LLPanel* child = panel.panel(); + + llassert(child); + if (!child) return; + const std::string& label = panel.label.isProvided() ? panel.label() : panel.panel()->getLabel(); -- cgit v1.2.3 From fa69f09e685bbb4b3b6faac825fd5c9af7100be5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:15:31 +0000 Subject: CID-202 Checker: REVERSE_INULL Function: LLScriptEventHandler::recurse(_iobuf *, int, int, e_lscript_compile_pass, e_lscript_prune_type, int &, LLScriptScope *, e_lscript_types &, e_lscript_types, unsigned long long &, LLScriptByteCodeChunk *, LLScriptByteCodeChunk *, int, LLScriptScopeEntry *, int, LLScriptLibData **) --- indra/lscript/lscript_compile/lscript_tree.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 4ba41db2fc..2a9a858947 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -9805,21 +9805,22 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom break; case LSCP_EMIT_BYTE_CODE: { - // order for event handler - // set jump table value - S32 jumpoffset; - jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; - - integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); - - // 0 - 3: offset to actual data - S32 offsetoffset = chunk->mCurrentOffset; - S32 offsetdelta = 0; - chunk->addBytes(4); - // null terminated event name and null terminated parameters + llassert(mEventp); if (mEventp) { + // order for event handler + // set jump table value + S32 jumpoffset; + jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; + + integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); + + // 0 - 3: offset to actual data + S32 offsetoffset = chunk->mCurrentOffset; + S32 offsetdelta = 0; + chunk->addBytes(4); + LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); -- cgit v1.2.3 From 45ea2bbd1e74be1d5158d3e38986f00cc53f0236 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:18:04 +0000 Subject: simpler fix for CID-202 --- indra/lscript/lscript_compile/lscript_tree.cpp | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index 2a9a858947..3d19de193a 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -9805,27 +9805,27 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom break; case LSCP_EMIT_BYTE_CODE: { - // null terminated event name and null terminated parameters llassert(mEventp); - if (mEventp) - { - // order for event handler - // set jump table value - S32 jumpoffset; - jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; - - integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); - - // 0 - 3: offset to actual data - S32 offsetoffset = chunk->mCurrentOffset; - S32 offsetdelta = 0; - chunk->addBytes(4); - - LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); - mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); - chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); - delete event; - } + if (!mEventp) return; + + // order for event handler + // set jump table value + S32 jumpoffset; + jumpoffset = LSCRIPTDataSize[LST_INTEGER]*get_event_handler_jump_position(gCurrentHandler, mEventp->mType)*2; + + integer2bytestream(chunk->mCodeChunk, jumpoffset, chunk->mCurrentOffset); + + // 0 - 3: offset to actual data + S32 offsetoffset = chunk->mCurrentOffset; + S32 offsetdelta = 0; + chunk->addBytes(4); + + // null terminated event name and null terminated parameters + LLScriptByteCodeChunk *event = new LLScriptByteCodeChunk(FALSE); + mEventp->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, event, heap, stacksize, entry, entrycount, NULL); + chunk->addBytes(event->mCodeChunk, event->mCurrentOffset); + delete event; + chunk->addBytes(1); // now we're at the first opcode -- cgit v1.2.3 From 66298ab6b6ffdf9a3694a0b9fd678ac382519b0a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:20:15 +0000 Subject: Bah, can't use llassert in llxuiparser. --- indra/llxuixml/llxuiparser.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 705e7137c2..dbc20a5a1e 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -324,7 +324,6 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p // add includes for all possible children const std::type_info* type = *LLWidgetTypeRegistry::instance().getValue(type_name); const widget_registry_t* widget_registryp = LLChildRegistryRegistry::instance().getValue(type); - llassert(widget_registryp); // add choices for valid children if (widget_registryp) -- cgit v1.2.3 From 9fee359d1baf6e0046655cb8e4afabb8774754b1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Sat, 13 Feb 2010 14:37:48 +0000 Subject: CID-3 Checker: CHECKED_RETURN Function: LLImageDecodeThread::update(unsigned int) File: /indra/llimage/llimageworker.cpp --- indra/llcommon/llsdserialize_xml.cpp | 15 +-------------- indra/llimage/llimageworker.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index 7e1c2e35e0..fca173df47 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -139,12 +139,8 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti case LLSD::TypeBoolean: ostr << pre << ""; if(mBoolAlpha || -#if( LL_WINDOWS || __GNUC__ > 2) (ostr.flags() & std::ios::boolalpha) -#else - (ostr.flags() & 0x0100) -#endif - ) + ) { ostr << (data.asBoolean() ? "true" : "false"); } @@ -511,12 +507,7 @@ void LLSDXMLParser::Impl::reset() mSkipping = false; -#if( LL_WINDOWS || __GNUC__ > 2) mCurrentKey.clear(); -#else - mCurrentKey = std::string(); -#endif - XML_ParserReset(mParser, "utf-8"); XML_SetUserData(mParser, this); @@ -644,11 +635,7 @@ void LLSDXMLParser::Impl::startElementHandler(const XML_Char* name, const XML_Ch LLSD& newElement = map[mCurrentKey]; mStack.push_back(&newElement); -#if( LL_WINDOWS || __GNUC__ > 2) mCurrentKey.clear(); -#else - mCurrentKey = std::string(); -#endif } else if (mStack.back()->isArray()) { diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 86d41515e7..20a72d0a28 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -54,9 +54,14 @@ S32 LLImageDecodeThread::update(U32 max_time_ms) { creation_info& info = *iter; ImageRequest* req = new ImageRequest(info.handle, info.image, - info.priority, info.discard, info.needs_aux, - info.responder); - addRequest(req); + info.priority, info.discard, info.needs_aux, + info.responder); + + bool res = addRequest(req); + if (!res) + { + llerrs << "request added after LLLFSThread::cleanupClass()" << llendl; + } } mCreationList.clear(); S32 res = LLQueuedThread::update(max_time_ms); -- cgit v1.2.3