bitsize respected in size calculation. (#9756)
This commit is contained in:
parent
2418d0cac5
commit
1e08fff2d5
3 changed files with 42 additions and 7 deletions
|
|
@ -1062,6 +1062,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
|||
invalidPragma(c, it)
|
||||
else:
|
||||
sym.bitsize = expectIntLit(c, it)
|
||||
if sym.bitsize <= 0:
|
||||
localError(c.config, it.info, "bitsize needs to be positive")
|
||||
of wGuard:
|
||||
if sym == nil or sym.kind notin {skVar, skLet, skField}:
|
||||
invalidPragma(c, it)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue