mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-10 23:22:33 +02:00
Catch exception inside preprocessor loop so that loop continues after
error (for unit tests). Also make sure to set ".loaded" variable before calling loadFromSource so that if an exception happens we won't try to load it again later. Fixes #2542.
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
validate the drop the same we we validate in dragMove to make sure
|
||||
the drop is valid.
|
||||
|
||||
* Fixed #2542. Catch exception inside preprocessor loop so that
|
||||
loop continues after error (for unit tests). Also make sure to
|
||||
set ".loaded" variable before calling loadFromSource so that if an
|
||||
exception happens we won't try to load it again later.
|
||||
|
||||
2011-06-27 theron <theron@netcitadel.com>
|
||||
|
||||
* Fixed #2530, where adding a subfolder opens the parent folder in
|
||||
|
||||
@@ -71,11 +71,9 @@ Preprocessor::Preprocessor(FWObjectDatabase *_db,
|
||||
void Preprocessor::convertObject(FWObject *obj)
|
||||
{
|
||||
MultiAddress *adt = MultiAddress::cast(obj);
|
||||
if (adt!=NULL && adt->isCompileTime() &&
|
||||
obj->getInt(".loaded") != infinite_recursion_breaker)
|
||||
if (adt!=NULL && adt->isCompileTime())
|
||||
{
|
||||
adt->loadFromSource(ipv6, inTestMode());
|
||||
obj->setInt(".loaded", infinite_recursion_breaker);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +105,16 @@ void Preprocessor::findMultiAddressObjectsUsedInRules(FWObject *top)
|
||||
else
|
||||
{
|
||||
FWObject *obj_ptr = FWReference::getObject(obj);
|
||||
if (obj_ptr->getInt(".loaded") == infinite_recursion_breaker)
|
||||
continue;
|
||||
obj_ptr->setInt(".loaded", infinite_recursion_breaker);
|
||||
|
||||
try
|
||||
{
|
||||
convertObject(obj_ptr);
|
||||
} catch (FWException &ex) {
|
||||
abort(ex.toString());
|
||||
}
|
||||
|
||||
// Note that MultiAddress inherits ObjectGroup
|
||||
if (Group::cast(obj_ptr))
|
||||
@@ -127,8 +134,6 @@ void Preprocessor::compile()
|
||||
infinite_recursion_breaker++;
|
||||
FWObject *rule_copy = NULL;
|
||||
|
||||
try
|
||||
{
|
||||
if (single_rule_mode)
|
||||
{
|
||||
rule_copy = dbcopy->findInIndex(single_rule_compile_rule->getId());
|
||||
@@ -138,10 +143,6 @@ void Preprocessor::compile()
|
||||
FWObject *fwcopy = dbcopy->findInIndex(fw->getId());
|
||||
findMultiAddressObjectsUsedInRules(fwcopy);
|
||||
}
|
||||
} catch (FWException &ex)
|
||||
{
|
||||
abort(ex.toString());
|
||||
}
|
||||
/* resolving MultiAddress objects */
|
||||
// convertObjectsRecursively(dbcopy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user