summary refs log tree commit diff stats
path: root/compiler/vmgen.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-07-09 09:07:45 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-09 09:07:45 +0200
commit11dad688fea4033417c17c5e5b8e3c61ddb51da8 (patch)
treedbce48861c2e6b266829abf23d21e558e5a6a17f /compiler/vmgen.nim
parentb50ae6817a8cf558eedbee5e405dd68a7d22edd8 (diff)
downloadNim-11dad688fea4033417c17c5e5b8e3c61ddb51da8.tar.gz
Offsetof fixes (#11690)
* first fixes

* more tests and fixes

* code normalization
Diffstat (limited to 'compiler/vmgen.nim')
-rw-r--r--compiler/vmgen.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index e221929a2..fe9772d08 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1310,8 +1310,12 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
       # produces a value
     else:
       globalError(c.config, n.info, "expandToAst requires a call expression")
-  of mSizeOf, mAlignOf:
-    globalError(c.config, n.info, "cannot evaluate 'sizeof/alignof' because its type is not defined completely")
+  of mSizeOf:
+    globalError(c.config, n.info, "cannot evaluate 'sizeof' because its type is not defined completely")
+  of mAlignOf:
+    globalError(c.config, n.info, "cannot evaluate 'alignof' because its type is not defined completely")
+  of mOffsetOf:
+    globalError(c.config, n.info, "cannot evaluate 'offsetof' because its type is not defined completely")
   of mRunnableExamples:
     discard "just ignore any call to runnableExamples"
   of mDestroy: discard "ignore calls to the default destructor"