Fix for GitHub issue #60 (part 1) - reject numeric constant with zero size.
This commit is contained in:
parent
301a7e587b
commit
c6e618350d
6
pform.cc
6
pform.cc
|
|
@ -1079,6 +1079,12 @@ verinum* pform_verinum_with_size(verinum*siz, verinum*val,
|
||||||
assert(siz->is_defined());
|
assert(siz->is_defined());
|
||||||
unsigned long size = siz->as_ulong();
|
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;
|
verinum::V pad;
|
||||||
|
|
||||||
switch (val->get(val->len()-1)) {
|
switch (val->get(val->len()-1)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue