Fix for GitHub issue #60 (part 1) - reject numeric constant with zero size.

This commit is contained in:
Martin Whitaker 2015-04-26 11:04:02 +01:00
parent 301a7e587b
commit c6e618350d
1 changed files with 6 additions and 0 deletions

View File

@ -1079,6 +1079,12 @@ verinum* pform_verinum_with_size(verinum*siz, verinum*val,
assert(siz->is_defined());
unsigned long size = siz->as_ulong();
if (size == 0) {
cerr << file << ":" << lineno << ": error: Sized numeric constant "
"must have a size greater than zero." << endl;
error_count += 1;
}
verinum::V pad;
switch (val->get(val->len()-1)) {