summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-06 20:06:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-06 20:06:53 -0700
commitc1f435f354ef95caf2019bf2aeb5143b36df0e50 (patch)
treedf0139411c21b6c390972325c196ea85d5d840d1
parent97dc422489a3621c6c68b43f1a98f5df947d84d8 (diff)
downloadtxr-c1f435f354ef95caf2019bf2aeb5143b36df0e50.tar.gz
txr-c1f435f354ef95caf2019bf2aeb5143b36df0e50.tar.bz2
txr-c1f435f354ef95caf2019bf2aeb5143b36df0e50.zip
ffi: bugfix: assign evaluated syntax to bitfield.
* ffi.c (ffi_type_compile): Give the bitfield type the evaluated syntax where the width expression is reduced to an integer value.
-rw-r--r--ffi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 89a83cd9..d961478a 100644
--- a/ffi.c
+++ b/ffi.c
@@ -3116,7 +3116,8 @@ val ffi_type_compile(val syntax)
} else if (sym == sbit_s || sym == ubit_s) {
val nbits = ffi_eval_expr(cadr(syntax), nil, nil);
cnum nb = c_num(nbits);
- val type = make_ffi_type_builtin(syntax, integer_s, 0, 0,
+ val xsyntax = list(sym, nbits, nao);
+ val type = make_ffi_type_builtin(xsyntax, integer_s, 0, 0,
&ffi_type_void,
if3(sym == sbit_s,
ffi_sbit_put, ffi_ubit_put),