fix: include correct main position and don't re-create label

This commit is contained in:
2025-03-14 15:51:34 +00:00
parent 8f7c902ed5
commit 68435207fe
6 changed files with 12 additions and 16 deletions

View File

@@ -51,9 +51,9 @@ private class LabelGenerator {
permittedFuncFile match {
case Some(f) if f != pos.file.getCanonicalPath => Chain.empty
case _ =>
val customLabel = if name == "main" then Chain.empty else Chain(LabelDef(name))
permittedFuncFile = Some(pos.file.getCanonicalPath)
Chain(
LabelDef(name),
customLabel ++ Chain(
Directive.Location(getDebugFile(pos.file), pos.line, None),
Directive.Type(label, SymbolType.Function),
Directive.Func(name, label)