VT-LOC-VALUE, used to retrieve the constant value of C locations, did not handle statically allocated constants

This commit is contained in:
Juan Jose Garcia Ripoll 2010-05-18 11:08:37 +02:00
parent 49d45942c5
commit a01e56cf83

View file

@ -138,11 +138,6 @@
(add-load-form object x))
x))))
(defun vt-loc-value (loc)
(case (car loc)
(VV (aref *permanent-objects* (second loc)))
(VV-TEMP (aref *temporary-objects* (second loc)))))
(defun add-symbol (symbol)
(add-object symbol :duplicate nil :permanent t))
@ -208,3 +203,15 @@
(let* ((c-name (format nil "_ecl_static_~D" (length *static-constants*))))
(push (list object c-name builder) *static-constants*)
`(VV ,c-name))))))))
(defun vt-loc-value (loc)
(flet ((static-constant-value (index)
(first (find loc *static-constants* :key #'second
:test #'string=))))
(let ((index (second loc)))
(cond ((stringp index)
(static-constant-value index))
((eq (car loc) 'VV)
(aref *permanent-objects* index))
(t
(VV-TEMP (aref *temporary-objects* index)))))))