From cbabfb4943d4b04507025ca2c979e025cc7337d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Mon, 22 Apr 2024 22:04:39 +0200 Subject: [PATCH] `` emitted as `[assembly:]` attribute, not module --- .../Emitter/Model/PEModuleBuilder.cs | 12 ++++++++++++ .../Semantics/SemanticsBinder.cs | 2 +- .../Symbols/Source/SourceModuleSymbol.cs | 11 ----------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Peachpie.CodeAnalysis/Emitter/Model/PEModuleBuilder.cs b/src/Peachpie.CodeAnalysis/Emitter/Model/PEModuleBuilder.cs index ceaef5ce25..d6cd17bf1f 100644 --- a/src/Peachpie.CodeAnalysis/Emitter/Model/PEModuleBuilder.cs +++ b/src/Peachpie.CodeAnalysis/Emitter/Model/PEModuleBuilder.cs @@ -18,6 +18,7 @@ using Pchp.CodeAnalysis.Emitter; using Pchp.CodeAnalysis.Utilities; using Pchp.CodeAnalysis.CodeGen; +using Pchp.CodeAnalysis.Semantics; namespace Pchp.CodeAnalysis.Emit { @@ -222,6 +223,17 @@ public ArrayMethods ArrayMethods } } + // [assembly: ...] + if (Compilation.Options.AssemblyAttributes != null) + { + var binder = new SemanticsBinder(Compilation, file: null); + + foreach (var attr in Compilation.Options.AssemblyAttributes) + { + yield return binder.BindAttribute(attr); + } + } + // yield break; } diff --git a/src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs b/src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs index 9ca41de82c..6c6d4a17ef 100644 --- a/src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs +++ b/src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs @@ -328,7 +328,7 @@ public ImmutableArray BindAttributes(IReadOnlyList CreateAttributesToEmit() } } - // user assembly attributes - if (DeclaringCompilation.Options.AssemblyAttributes != null) - { - var binder = new SemanticsBinder(DeclaringCompilation, file: null); - - foreach (var attr in DeclaringCompilation.Options.AssemblyAttributes) - { - yield return binder.BindAttribute(attr); - } - } - // yield break; }