Fix gcc 2.7.2.3 crash on startup (orange on speedracer and worms tinderboxes). gcc 2.7.2.3 doesn't seem to follow the rule in C++ 12.2, clause 5, on the lifetime of temporaries bound to references.

This commit is contained in:
dbaron%fas.harvard.edu 2001-05-19 16:05:10 +00:00
Родитель 80519a64ce
Коммит ca406deb8e
3 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -95,7 +95,7 @@ nsScriptNameSpaceManager::FillHash(nsICategoryManager *aCategoryManager,
continue;
}
const nsAString& temp = NS_ConvertASCIItoUCS2(categoryEntry);
NS_ConvertASCIItoUCS2 temp(categoryEntry);
// XXX Mac chokes _later_ if we put the |NS_Conv...| right in the |nsStringKey| ctor, so make a temp
nsStringKey key(temp);

Просмотреть файл

@ -95,7 +95,7 @@ nsScriptNameSpaceManager::FillHash(nsICategoryManager *aCategoryManager,
continue;
}
const nsAString& temp = NS_ConvertASCIItoUCS2(categoryEntry);
NS_ConvertASCIItoUCS2 temp(categoryEntry);
// XXX Mac chokes _later_ if we put the |NS_Conv...| right in the |nsStringKey| ctor, so make a temp
nsStringKey key(temp);

Просмотреть файл

@ -973,7 +973,9 @@ nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile)
NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
nsISupports *subject = (nsISupports *)((nsIProfile *)this);
const nsAFlatString& context = isSwitch ? NS_LITERAL_STRING("switch") : NS_LITERAL_STRING("startup");
NS_NAMED_LITERAL_STRING(switchString, "switch");
NS_NAMED_LITERAL_STRING(startupString, "startup");
const nsAFlatString& context = isSwitch ? switchString : startupString;
if (isSwitch)
{
@ -1050,7 +1052,10 @@ NS_IMETHODIMP nsProfile::ShutDownCurrentProfile(PRUint32 shutDownType)
NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
nsISupports *subject = (nsISupports *)((nsIProfile *)this);
const nsAFlatString& context = (shutDownType == SHUTDOWN_CLEANSE) ? NS_LITERAL_STRING("shutdown-cleanse") : NS_LITERAL_STRING("shutdown-persist");
NS_NAMED_LITERAL_STRING(cleanseString, "shutdown-cleanse");
NS_NAMED_LITERAL_STRING(persistString, "shutdown-persist");
const nsAFlatString& context = (shutDownType == SHUTDOWN_CLEANSE) ? cleanseString : persistString;
// Phase 1: See if anybody objects to the profile being changed.
mProfileChangeVetoed = PR_FALSE;