fixing the inline flag delegation with generic functions

This commit is contained in:
Jakub Doka 2024-11-12 17:32:20 +01:00
parent 9949086011
commit 80fd0e89b4
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -3850,11 +3850,11 @@ impl<'a> Codegen<'a> {
let (v, ctrl, scope) = mem::replace(&mut self.ci.inline_ret, prev_inline_ret)?; let (v, ctrl, scope) = mem::replace(&mut self.ci.inline_ret, prev_inline_ret)?;
if is_inline if is_inline
&& (ctrl.get() != prev_ctrl && ctrl.get() != prev_ctrl
&& (!matches!(self.ci.nodes[ctrl.get()].kind, Kind::Call { && (!matches!(self.ci.nodes[ctrl.get()].kind, Kind::Call {
func: ty::Func::ECA, func: ty::Func::ECA,
.. ..
}) || self.ci.nodes[ctrl.get()].inputs[0] != prev_ctrl)) }) || self.ci.nodes[ctrl.get()].inputs[0] != prev_ctrl)
{ {
self.report(body.pos(), "function is makred inline but it contains controlflow"); self.report(body.pos(), "function is makred inline but it contains controlflow");
} }
@ -4075,6 +4075,7 @@ impl<'a> Codegen<'a> {
base: Some(*func), base: Some(*func),
sig: Some(Sig { args, ret }), sig: Some(Sig { args, ret }),
expr: fuc.expr, expr: fuc.expr,
is_inline: fuc.is_inline,
..Default::default() ..Default::default()
}) })
.into() .into()