From b456a32cf0510dac4f5ffa319b02e1cee24e82de Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 6 Oct 2018 15:36:32 +0200 Subject: [PATCH] mescc: Make globals at least reg-size. * module/mescc/compile.scm (global->info): Make globals at least reg-size. --- module/mescc/compile.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/mescc/compile.scm b/module/mescc/compile.scm index aefa580d..bd2a0d3a 100644 --- a/module/mescc/compile.scm +++ b/module/mescc/compile.scm @@ -2151,7 +2151,8 @@ (define (global->info type name o init info) (let* ((rank (->rank type)) (size (->size type info)) - (data (cond ((not init) (string->list (make-string size #\nul))) + (reg-size (->size "*" info)) + (data (cond ((not init) (string->list (make-string (max size reg-size) #\nul))) ((c-array? type) (let* ((string (array-init->string init)) (size (or (and string (max size (1+ (string-length string)))) @@ -2164,7 +2165,7 @@ (append data (string->list (make-string (max 0 (- size (length data))) #\nul))))) (else (let ((data (init->data type init info))) - (append data (string->list (make-string (max 0 (- size (length data))) #\nul))))))) + (append data (string->list (make-string (max 0 (- (max size reg-size) (length data))) #\nul))))))) (global (make-global-entry name type data))) (clone info #:globals (append (.globals info) (list global)))))