SCF_OP_3AC_JB,
SCF_OP_3AC_JBE,
- SCF_OP_3AC_PUSH, // push a var to stack, only for 3ac & native
+ SCF_OP_3AC_PUSH, // push a var to stack, only for 3ac & native
SCF_OP_3AC_POP, // pop a var from stack, only for 3ac & native
SCF_OP_3AC_PUSH_RAX, // push rax, only for 3ac & native
// 122
SCF_VAR_U8,
SCF_VAR_VOID,
+ SCF_VAR_BIT,
SCF_VAR_U16,
SCF_VAR_U32,
SCF_VAR_U64,
SCF_VAR_DOUBLE, // double variable
- SCF_LABEL, // label
+ SCF_LABEL, // label
SCF_FUNCTION, // function
{"int", SCF_LEX_WORD_KEY_INT},
{"float", SCF_LEX_WORD_KEY_FLOAT},
{"double", SCF_LEX_WORD_KEY_DOUBLE},
+ {"bit", SCF_LEX_WORD_KEY_BIT},
{"int8_t", SCF_LEX_WORD_KEY_INT8},
{"int16_t", SCF_LEX_WORD_KEY_INT16},
for (j = 0; j < bb->prevs->size; j++) {
prev = bb->prevs->data[j];
- if (prev->index > bb->index)
+ if (prev->index >= bb->index)
continue;
for (k = 0; k < prev->dn_colors_exit->size; k++) {
assert(var_size == r->bytes);
if (scf_variable_const(v)) {
- scf_logw("const literal var: v_%s_%d_%d not save\n", v->w->text->data, v->w->line, v->w->pos);
+ if (v->w)
+ scf_logw("const literal var: v_%s_%d_%d not save\n", v->w->text->data, v->w->line, v->w->pos);
+ else
+ scf_logw("const literal var: v_%#lx not save\n", 0xffff & (uintptr_t)v);
goto end;
}
scf_loge("current_block: %p, parent_block: %p\n", parse->ast->current_block, fd->parent_block);
+ if (3 == fd->_for->nb_nodes)
+ scf_node_add_child(fd->_for, NULL);
+
assert(parse->ast->current_block == fd->parent_block);
d->current_node = fd->parent_node;
} \
} while (0)
-scf_base_type_t base_types[] = {
- {SCF_VAR_CHAR, "char", 1},
+scf_base_type_t base_types[] =
+{
+ {SCF_VAR_CHAR, "char", 1},
- {SCF_VAR_VOID, "void", 1},
+ {SCF_VAR_VOID, "void", 1},
+ {SCF_VAR_BIT, "bit", 1},
- {SCF_VAR_INT, "int", 4},
- {SCF_VAR_FLOAT, "float", 4},
- {SCF_VAR_DOUBLE, "double", 8},
+ {SCF_VAR_INT, "int", 4},
+ {SCF_VAR_FLOAT, "float", 4},
+ {SCF_VAR_DOUBLE, "double", 8},
{SCF_VAR_I8, "int8_t", 1},
{SCF_VAR_I16, "int16_t", 2},