lifting the restriction for inlining to allow normal functions as well

Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
This commit is contained in:
Jakub Doka 2024-12-17 19:32:30 +01:00
parent 3702a99d03
commit 47014c6164
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -2575,7 +2575,7 @@ impl<'a> Codegen<'a> {
mem::replace(&mut self.ci.inline_ret, prev_inline_ret)?;
if is_inline
&& ctrl.get() != prev_ctrl
&& (!self.ci.nodes[ctrl.get()].kind.is_eca()
&& (!self.ci.nodes[ctrl.get()].kind.is_call()
|| self.ci.nodes[ctrl.get()].inputs[0] != prev_ctrl)
{
self.error(body.pos(), "function is makred inline but it contains controlflow");