From d97e3589f6ba0ff7ec3d0b6c25b680c4691ac886 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 22 Mar 2011 16:49:33 +0000 Subject: [PATCH] 1.0.46.41: double-check simple functions in looks_like_valid_lisp_pointer_p * A function contained in a code object is always a simple function. Make sure that we actually have one, instead of a random location in the code object. --- src/runtime/gencgc.c | 8 ++++++-- version.lisp-expr | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 72e1459..288e968 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -2238,8 +2238,12 @@ looks_like_valid_lisp_pointer_p(lispobj *pointer, lispobj *start_addr) * header. */ switch (widetag_of(*start_addr)) { case CODE_HEADER_WIDETAG: - /* This case is probably caught above. */ - break; + /* Make sure we actually point to a function in the code object, + * as opposed to a random point there. */ + if (SIMPLE_FUN_HEADER_WIDETAG==widetag_of(*(pointer-FUN_POINTER_LOWTAG))) + return 1; + else + return 0; case CLOSURE_HEADER_WIDETAG: case FUNCALLABLE_INSTANCE_HEADER_WIDETAG: if ((unsigned long)pointer != diff --git a/version.lisp-expr b/version.lisp-expr index c751f72..d894814 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -20,4 +20,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.46.40" +"1.0.46.41" -- 1.7.10.4