added missing .noalias support for object fields (#15445)

This commit is contained in:
Andreas Rumpf 2020-10-01 09:46:50 +02:00 • committed by GitHub
commit b703f02ad2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -1,8 +1,13 @@
discard """
ccodecheck: "\\i@'NIM_CHAR* NIM_NOALIAS x,' @'void* NIM_NOALIAS q'"
ccodecheck: "\\i@'NI* NIM_NOALIAS field;' @'NIM_CHAR* NIM_NOALIAS x,' @'void* NIM_NOALIAS q'"
"""
type
BigNum = object
field {.noalias.}: ptr UncheckedArray[int]
proc p(x {.noalias.}: openArray[char]) =
var q {.noalias.}: pointer = unsafeAddr(x[0])
var bn: BigNum
p "abc"