Don't allow regexps to be evaluated in a boolean context.
This commit is contained in:
parent
589eabd8e6
commit
96e11c5937
1 changed files with 3 additions and 5 deletions
|
|
@ -211,18 +211,16 @@ value_t::operator bool() const
|
||||||
return as_balance_pair();
|
return as_balance_pair();
|
||||||
case STRING:
|
case STRING:
|
||||||
return ! as_string().empty();
|
return ! as_string().empty();
|
||||||
case MASK:
|
|
||||||
return ! as_mask().empty();
|
|
||||||
case SEQUENCE:
|
case SEQUENCE:
|
||||||
return ! as_sequence().empty();
|
return ! as_sequence().empty();
|
||||||
case POINTER:
|
case POINTER:
|
||||||
return ! as_any_pointer().empty();
|
return ! as_any_pointer().empty();
|
||||||
default:
|
default:
|
||||||
assert(false);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(false);
|
|
||||||
return 0;
|
throw_(value_error, "Cannot determine truth of " << label());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool value_t::to_boolean() const
|
bool value_t::to_boolean() const
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue