diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-01-13 14:11:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 14:11:51 +0100 |
commit | abea80376a113fb218c22b6474727c279e694cd3 (patch) | |
tree | 815732fca2ea3f875b415b5fa1d9b6cb882535e5 /compiler/pragmas.nim | |
parent | bf2e052e6d97c1117603480547804dd98d1ada71 (diff) | |
download | Nim-abea80376a113fb218c22b6474727c279e694cd3.tar.gz |
fixes #13122 (#13126)
* fixes #13122 * moved tests to where they belong
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r-- | compiler/pragmas.nim | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 1802493f4..0004fe94b 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -819,12 +819,10 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int, localError(c.config, it.info, "size may only be 1, 2, 4 or 8") of wAlign: let alignment = expectIntLit(c, it) - if alignment == 0: - discard - elif isPowerOfTwo(alignment): + if isPowerOfTwo(alignment) and alignment > 0: sym.alignment = max(sym.alignment, alignment) else: - localError(c.config, it.info, "power of two or 0 expected") + localError(c.config, it.info, "power of two expected") of wNodecl: noVal(c, it) incl(sym.loc.flags, lfNoDecl) |