mescc: Tinycc support: Handle short struct initializer.
* module/language/c99/compiler.mes (array-init-element->data): Handle short struct initializer.
This commit is contained in:
parent
029c000840
commit
932b38980e
|
@ -2102,7 +2102,11 @@
|
|||
(int->bv type (expr->number info fixed)))
|
||||
((initzer (initzer-list . ,inits))
|
||||
(if (structured-type? type)
|
||||
(map (cut init->data <> <> info) (map cdr (struct->init-fields type)) inits)
|
||||
(let* ((fields (map cdr (struct->init-fields type)))
|
||||
(missing (max 0 (- (length fields) (length inits))))
|
||||
(inits (append inits
|
||||
(map (const '(fixed "0")) (iota missing)))))
|
||||
(map (cut init->data <> <> info) fields inits))
|
||||
(begin
|
||||
(stderr "array-init-element->data: oops:~s\n" o)
|
||||
(stderr "type:~s\n" type)
|
||||
|
|
Loading…
Reference in a new issue