- Fix a few more problems when creating and emitting constants
[libfirm] / ir / be / ia32 / ia32_new_nodes.c
index 1c1aaea..f100c24 100644 (file)
@@ -566,12 +566,13 @@ long get_ia32_am_offs_long(const ir_node *node) {
  */
 static void extend_ia32_am_offs(ir_node *node, char *offset, char op) {
        ia32_attr_t *attr = get_ia32_attr(node);
-       int o;
+       int res, o;
 
        if (! offset || strlen(offset) < 1)
                return;
 
-       assert(sscanf(offset, "%d", &o) == 1);
+       res = sscanf(offset, "%d", &o);
+       assert(res == 1);
 
        if (op == '-')
                attr->am_offs -= o;
@@ -1171,8 +1172,9 @@ void set_ia32_Const_attr(ir_node *ia32_cnst, ir_node *cnst) {
                        attr->cnst_val.tv = get_Const_tarval(cnst);
                        mode = get_tarval_mode(attr->cnst_val.tv);
                        if (mode_is_reference(mode) &&
-                           get_mode_null(mode) == attr->cnst_val.tv)
-                               attr->cnst_val.tv = get_mode_null(mode_Is);
+                           get_mode_null(mode) == attr->cnst_val.tv) {
+                               attr->cnst_val.tv = get_mode_null(mode_Iu);
+                       }
                        attr->cnst        = get_ident_for_tv(attr->cnst_val.tv);
                        break;
                case iro_SymConst: