diff --git a/assembly/src/assembler/mod.rs b/assembly/src/assembler/mod.rs index 6181d6b4e..ea9b8fd73 100644 --- a/assembly/src/assembler/mod.rs +++ b/assembly/src/assembler/mod.rs @@ -430,6 +430,7 @@ impl Assembler { procedure_gid, name, proc.visibility(), + module.is_kernel(), self.source_manager.clone(), ) .with_num_locals(num_locals) @@ -452,6 +453,7 @@ impl Assembler { procedure_gid, name, ast::Visibility::Public, + module.is_kernel(), self.source_manager.clone(), ) .with_span(proc_alias.span()); diff --git a/assembly/src/assembler/procedure.rs b/assembly/src/assembler/procedure.rs index 17c2cb145..c1a59063b 100644 --- a/assembly/src/assembler/procedure.rs +++ b/assembly/src/assembler/procedure.rs @@ -21,6 +21,7 @@ pub struct ProcedureContext { span: SourceSpan, name: QualifiedProcedureName, visibility: Visibility, + is_kernel: bool, num_locals: u16, callset: CallSet, } @@ -32,6 +33,7 @@ impl ProcedureContext { gid: GlobalProcedureIndex, name: QualifiedProcedureName, visibility: Visibility, + is_kernel: bool, source_manager: Arc, ) -> Self { Self { @@ -40,6 +42,7 @@ impl ProcedureContext { span: name.span(), name, visibility, + is_kernel, num_locals: 0, callset: Default::default(), } @@ -76,8 +79,9 @@ impl ProcedureContext { &self.name.module } + /// Returns true if the procedure is being assembled for a kernel. pub fn is_kernel(&self) -> bool { - self.visibility.is_syscall() + self.is_kernel } #[inline(always)]