restore location in gcc alloca codegen
This commit is contained in:
parent
d46b688945
commit
1ce5dc8d9c
1 changed files with 7 additions and 1 deletions
|
@ -902,7 +902,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
|
||||||
let ty = self.cx.type_array(self.cx.type_i8(), size.bytes()).get_aligned(align.bytes());
|
let ty = self.cx.type_array(self.cx.type_i8(), size.bytes()).get_aligned(align.bytes());
|
||||||
// TODO(antoyo): It might be better to return a LValue, but fixing the rustc API is non-trivial.
|
// TODO(antoyo): It might be better to return a LValue, but fixing the rustc API is non-trivial.
|
||||||
self.stack_var_count.set(self.stack_var_count.get() + 1);
|
self.stack_var_count.set(self.stack_var_count.get() + 1);
|
||||||
self.current_func().new_local(None, ty, &format!("stack_var_{}", self.stack_var_count.get())).get_address(None)
|
self.current_func()
|
||||||
|
.new_local(
|
||||||
|
self.location,
|
||||||
|
ty,
|
||||||
|
&format!("stack_var_{}", self.stack_var_count.get()),
|
||||||
|
)
|
||||||
|
.get_address(self.location)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dynamic_alloca(&mut self, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
|
fn dynamic_alloca(&mut self, _len: RValue<'gcc>, _align: Align) -> RValue<'gcc> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue