From 656bf98749609b25613d2363e715cb09ca68e58e Mon Sep 17 00:00:00 2001 From: George Mamais Date: Sun, 15 Dec 2024 10:15:51 +0200 Subject: [PATCH] Fix bug in ICD generation This bug was introduced by merging PR #317. The issue caused the ICD tables for sequences, choices, and similar components to be empty when their child components were primitive types. --- BackendAst/DAstACN.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BackendAst/DAstACN.fs b/BackendAst/DAstACN.fs index 4f1865c5..561939f2 100644 --- a/BackendAst/DAstACN.fs +++ b/BackendAst/DAstACN.fs @@ -291,7 +291,13 @@ let private createAcnFunction (r: Asn1AcnAst.AstRoot) let sInitialExp = "" let func, funcDef, auxiliaries, icdResult, ns2 = match funcNameAndtasInfo with - | None -> None, None, [], None, ns + | None -> + let content, ns1a = funcBody ns errCode [] (NestingScope.init t.acnMaxSizeInBits t.uperMaxSizeInBits []) p + let icdResult = + match content with + | None -> None + | Some bodyResult -> bodyResult.icdResult + None, None, [], icdResult, ns1a | Some funcName -> let precondAnnots = lm.lg.generatePrecond r ACN t codec let postcondAnnots = lm.lg.generatePostcond r ACN funcNameBase p t codec