mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 22:40:34 +02:00
Don't serialize uninterned symbols
* module/system/vm/assembler.scm (intern-constant): Don't serialize uninterned symbols. * test-suite/tests/rtl.test ("bad constants"): Add a test.
This commit is contained in:
parent
2c8ea5a008
commit
1d72d46951
2 changed files with 12 additions and 0 deletions
|
@ -1034,6 +1034,8 @@ table, its existing label is used directly."
|
||||||
`((static-patch! ,label 1 ,(static-procedure-code obj))))
|
`((static-patch! ,label 1 ,(static-procedure-code obj))))
|
||||||
((cache-cell? obj) '())
|
((cache-cell? obj) '())
|
||||||
((symbol? obj)
|
((symbol? obj)
|
||||||
|
(unless (symbol-interned? obj)
|
||||||
|
(error "uninterned symbol cannot be saved to object file" obj))
|
||||||
`((make-non-immediate 1 ,(recur (symbol->string obj)))
|
`((make-non-immediate 1 ,(recur (symbol->string obj)))
|
||||||
(string->symbol 1 1)
|
(string->symbol 1 1)
|
||||||
(static-set! 1 ,label 0)))
|
(static-set! 1 ,label 0)))
|
||||||
|
|
|
@ -77,6 +77,16 @@ a procedure."
|
||||||
;; FIXME: Add more tests for arrays (uniform and otherwise)
|
;; FIXME: Add more tests for arrays (uniform and otherwise)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(define-syntax-rule (assert-bad-constants val ...)
|
||||||
|
(begin
|
||||||
|
(pass-if-exception (object->string val) exception:miscellaneous-error
|
||||||
|
(return-constant val))
|
||||||
|
...))
|
||||||
|
|
||||||
|
(with-test-prefix "bad constants"
|
||||||
|
(assert-bad-constants (make-symbol "foo")
|
||||||
|
(lambda () 100)))
|
||||||
|
|
||||||
(with-test-prefix "static procedure"
|
(with-test-prefix "static procedure"
|
||||||
(assert-equal 42
|
(assert-equal 42
|
||||||
(((assemble-program `((begin-program foo
|
(((assemble-program `((begin-program foo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue