aboutsummaryrefslogtreecommitdiff
path: root/src/exact_value.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-05-09 13:04:15 +0100
committergingerBill <bill@gingerbill.org>2019-05-09 13:04:15 +0100
commit71a733e3b5bda4e8baafac35c7140e0b3a0d9445 (patch)
treecc6feb3b929b52d6cd75c1caf4f75231935c7f60 /src/exact_value.cpp
parenta66612e8aed520c8068a0c626056dd096f67eb65 (diff)
Allow booleans to be assigned to a 1-bit bit field value
Diffstat (limited to 'src/exact_value.cpp')
-rw-r--r--src/exact_value.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp
index d1d44b7dd..428690291 100644
--- a/src/exact_value.cpp
+++ b/src/exact_value.cpp
@@ -280,6 +280,13 @@ ExactValue exact_value_from_basic_literal(Token token) {
ExactValue exact_value_to_integer(ExactValue v) {
switch (v.kind) {
+ case ExactValue_Bool: {
+ i64 i = 0;
+ if (v.value_bool) {
+ i = 1;
+ }
+ return exact_value_i64(i);
+ }
case ExactValue_Integer:
return v;
case ExactValue_Float: {