X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fhost-alieneval.lisp;h=267a652d77995841937ce504133ebc7b5386fe90;hb=395c461b58f0cd484c21913c1e075593c206b5c1;hp=29bb28f2f330a634c04f64081ed56865eb7faba3;hpb=273757631306c5d5c36f3aa7fed496a6d5c5f35e;p=sbcl.git diff --git a/src/code/host-alieneval.lisp b/src/code/host-alieneval.lisp index 29bb28f..267a652 100644 --- a/src/code/host-alieneval.lisp +++ b/src/code/host-alieneval.lisp @@ -658,8 +658,16 @@ (auxiliary-alien-type :enum name env) (when old-p (unless (alien-type-= result old) - (warn "redefining alien enum ~S" name)))) - (setf (auxiliary-alien-type :enum name env) result)) + (cerror "Continue, clobbering the old definition" + "Incompatible alien enum type definition: ~S" name) + (setf (alien-type-from old) (alien-type-from result) + (alien-type-to old) (alien-type-to result) + (alien-type-kind old) (alien-type-kind result) + (alien-type-offset old) (alien-type-offset result) + (alien-type-signed old) (alien-type-signed result))) + (setf result old)) + (unless old-p + (setf (auxiliary-alien-type :enum name env) result)))) result)) (name (multiple-value-bind (result found) @@ -869,13 +877,15 @@ (define-alien-type-method (mem-block :extract-gen) (type sap offset) (declare (ignore type)) - `(sap+ ,sap (/ ,offset sb!vm:n-byte-bits))) + `(sap+ ,sap (truncate ,offset sb!vm:n-byte-bits))) (define-alien-type-method (mem-block :deposit-gen) (type sap offset value) - (let ((bytes (truncate (alien-mem-block-type-bits type) sb!vm:n-byte-bits))) - (unless bytes + (let ((bits (alien-mem-block-type-bits type))) + (unless bits (error "can't deposit aliens of type ~S (unknown size)" type)) - `(sb!kernel:system-area-ub8-copy ,value 0 ,sap ,offset ',bytes))) + `(sb!kernel:system-area-ub8-copy ,value 0 ,sap + (truncate ,offset sb!vm:n-byte-bits) + ',(truncate bits sb!vm:n-byte-bits)))) ;;;; the ARRAY type