From c6e618350dd5de9ad1b55d10ea45a6291f778c64 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 26 Apr 2015 11:04:02 +0100 Subject: [PATCH] Fix for GitHub issue #60 (part 1) - reject numeric constant with zero size. --- pform.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pform.cc b/pform.cc index 5fc2645ce..79cc05cf5 100644 --- a/pform.cc +++ b/pform.cc @@ -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)) {