summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-09-03 17:34:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-09-03 17:34:50 -0700
commitd20655669bd6f94cdd9fb2472668e92a069c0cf2 (patch)
tree610e9a9ea0948470c015568ca1e7ccf8bcdd03ef /src/alloc.c
parent5f089ac93f18fbd6e8131b81e1c6b403894b5759 (diff)
downloademacs-d20655669bd6f94cdd9fb2472668e92a069c0cf2.tar.gz
Avoid casting -1 to possibly-unsigned enum
* src/alloc.c (mark_maybe_pointer): * src/pdumper.h (pdumper_object_p_precise): Use pdumper_valid_object_type_p. * src/pdumper.c (pdumper_find_object_type_impl): * src/pdumper.h (pdumper_find_object_type): Return int, not enum Lisp_Type. All callers changed. * src/pdumper.h (PDUMPER_NO_OBJECT): Do not cast -1 to enum Lisp_Type; in theory, C18 says this could yield 7, which would mean PDUMPER_NO_OBJECT == Lisp_Float (!). (pdumper_valid_object_type_p): New function.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5f8ef0a5dda..089f61f8339 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4617,11 +4617,11 @@ mark_maybe_pointer (void *p)
if (pdumper_object_p (p))
{
- enum Lisp_Type type = pdumper_find_object_type (p);
- if (type != PDUMPER_NO_OBJECT)
- mark_object ((type == Lisp_Symbol)
- ? make_lisp_symbol(p)
- : make_lisp_ptr(p, type));
+ int type = pdumper_find_object_type (p);
+ if (pdumper_valid_object_type_p (type))
+ mark_object (type == Lisp_Symbol
+ ? make_lisp_symbol (p)
+ : make_lisp_ptr (p, type));
/* See mark_maybe_object for why we can confidently return. */
return;
}