diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-09 13:04:15 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-09 13:04:15 +0100 |
| commit | 71a733e3b5bda4e8baafac35c7140e0b3a0d9445 (patch) | |
| tree | cc6feb3b929b52d6cd75c1caf4f75231935c7f60 /src/exact_value.cpp | |
| parent | a66612e8aed520c8068a0c626056dd096f67eb65 (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.cpp | 7 |
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: { |