*** empty log message ***
[libfirm] / ir / common / firm_common.c
index bcd54f6..6922cef 100644 (file)
 
 #include "firm_common_t.h"
 #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;
 }