Esempio n. 1
0
static void sanitize_assert(const out_val *cond, out_ctx *octx, const char *desc)
{
    out_blk *land = out_blk_new(octx, "san_end");
    out_blk *blk_undef = out_blk_new(octx, "san_bad");

    out_ctrl_branch(octx,
                    cond,
                    land,
                    blk_undef);

    out_current_blk(octx, blk_undef);
    out_comment(octx, "sanitizer for %s", desc);
    if(cc1_sanitize_handler_fn) {
        type *voidty = type_nav_btype(cc1_type_nav, type_void);
        funcargs *args = funcargs_new();
        type *fnty_noptr = type_func_of(voidty, args, NULL);
        type *fnty_ptr = type_ptr_to(fnty_noptr);
        char *mangled = func_mangle(cc1_sanitize_handler_fn, fnty_noptr);

        const out_val *fn = out_new_lbl(octx, fnty_ptr, mangled, 0);

        out_val_release(octx, out_call(octx, fn, NULL, fnty_ptr));

        if(mangled != cc1_sanitize_handler_fn)
            free(mangled);
    }
    out_ctrl_end_undefined(octx);

    out_current_blk(octx, land);
}
Esempio n. 2
0
const char *decl_asm_spel(decl *d)
{
	if(!d->spel_asm)
		d->spel_asm = func_mangle(d->spel, type_is(d->ref, type_func));

	return d->spel_asm;
}