body is not properly ignored in CASE that has no matching WHEN

the `body` type is ignored because only `branch` is checked,
and so `body` falls into the `throw` for unknown type.

Fix is to add a dynamic check for `body` and ignore it.
This commit is contained in:
Christopher Lord
2018-04-24 16:08:58 -06:00
parent 7850d67654
commit 7fdc0a4211
+5 -1
View File
@@ -525,7 +525,7 @@ public:
while(it != steps.end())
{
bool increased = false;
// see if this is a branch or body
// see if this is a branch
if(dynamic_cast<const branch<CT>*>(*it) || dynamic_cast<const branch<const CT>*>(*it))
{
// branch. Execute it, see if it returns true or false
@@ -558,6 +558,10 @@ public:
}
}
}
else if(dynamic_cast<const body*>(*it))
{
// skip body
}
else
{
throw(std::string("invalid type:") + typeid(*it).name());