projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d54e02b
)
get_kind() did not assert anymore, instead returns k_BAD.
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Apr 2004 06:25:31 +0000
(06:25 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Apr 2004 06:25:31 +0000
(06:25 +0000)
[r2637]
ir/common/firm_common.c
patch
|
blob
|
history
diff --git
a/ir/common/firm_common.c
b/ir/common/firm_common.c
index
ef3e6ee
..
6922cef
100644
(file)
--- a/
ir/common/firm_common.c
+++ b/
ir/common/firm_common.c
@@
-19,11
+19,16
@@
#include "irgraph.h"
#include "irloop.h"
+/**
+ * Ideally, this macro would check if size bytes could be read at
+ * pointer p. No generic solution.
+ */
+#define POINTER_READ(p, size) (p)
+
/* returns the kind of the thing */
firm_kind
get_kind (const void *firm_thing) {
- assert (firm_thing);
- return *(firm_kind *)firm_thing;
+ return POINTER_READ(firm_thing, sizeof(firm_kind)) ? *(firm_kind *)firm_thing : k_BAD;
}