Commit f91f8772 authored by Matthias Braun's avatar Matthias Braun
Browse files

be: Use rbitset_alloca() instead of rbitset_malloc()

This plugs a memory leak.
parent 74d89854
......@@ -76,7 +76,7 @@ static void introduce_prologue(ir_graph *const irg)
static void TEMPLATE_generate_code(FILE *output, const char *cup_name)
{
be_begin(output, cup_name);
unsigned *const sp_is_non_ssa = rbitset_malloc(N_TEMPLATE_REGISTERS);
unsigned *const sp_is_non_ssa = rbitset_alloca(N_TEMPLATE_REGISTERS);
rbitset_set(sp_is_non_ssa, REG_SP);
foreach_irp_irg(i, irg) {
......
......@@ -658,7 +658,7 @@ static void amd64_generate_code(FILE *output, const char *cup_name)
{
amd64_constants = pmap_create();
be_begin(output, cup_name);
unsigned *const sp_is_non_ssa = rbitset_malloc(N_AMD64_REGISTERS);
unsigned *const sp_is_non_ssa = rbitset_alloca(N_AMD64_REGISTERS);
rbitset_set(sp_is_non_ssa, REG_RSP);
foreach_irp_irg(i, irg) {
......
......@@ -170,7 +170,7 @@ static void arm_generate_code(FILE *output, const char *cup_name)
be_gas_elf_type_char = '%';
be_begin(output, cup_name);
unsigned *const sp_is_non_ssa = rbitset_malloc(N_ARM_REGISTERS);
unsigned *const sp_is_non_ssa = rbitset_alloca(N_ARM_REGISTERS);
rbitset_set(sp_is_non_ssa, REG_SP);
arm_emit_file_prologue();
......
......@@ -1480,7 +1480,7 @@ static void ia32_generate_code(FILE *output, const char *cup_name)
ia32_tv_ent = pmap_create();
be_begin(output, cup_name);
unsigned *const sp_is_non_ssa = rbitset_malloc(N_IA32_REGISTERS);
unsigned *const sp_is_non_ssa = rbitset_alloca(N_IA32_REGISTERS);
rbitset_set(sp_is_non_ssa, REG_ESP);
foreach_irp_irg(i, irg) {
......
......@@ -428,7 +428,7 @@ static void sparc_generate_code(FILE *output, const char *cup_name)
sparc_constants = pmap_create();
be_begin(output, cup_name);
unsigned *const sp_is_non_ssa = rbitset_malloc(N_SPARC_REGISTERS);
unsigned *const sp_is_non_ssa = rbitset_alloca(N_SPARC_REGISTERS);
rbitset_set(sp_is_non_ssa, REG_SP);
foreach_irp_irg(i, irg) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment