summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2012-08-27 20:52:15 +0200
committerMike Pall <mike>2012-08-27 20:53:37 +0200
commitc7826af5a0403b48eeeb6c18532dc076146b1966 (patch)
treeb5f1e86268e3e4ab49d3bb4c8044a9efd61d322f /doc
parent76b18b2b465532e528af2162e79365794c8ba290 (diff)
downloadluajit-c7826af5a0403b48eeeb6c18532dc076146b1966.tar.gz
luajit-c7826af5a0403b48eeeb6c18532dc076146b1966.tar.bz2
luajit-c7826af5a0403b48eeeb6c18532dc076146b1966.zip
FFI: Detect type punning through unions.
Diffstat (limited to 'doc')
-rw-r--r--doc/ext_ffi_semantics.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html
index afe7e613..56b3f62e 100644
--- a/doc/ext_ffi_semantics.html
+++ b/doc/ext_ffi_semantics.html
@@ -192,8 +192,8 @@ a <tt>typedef</tt>, except re-declarations will be ignored):
192 192
193</ul> 193</ul>
194<p> 194<p>
195You're encouraged to use these types in preference to the 195You're encouraged to use these types in preference to
196compiler-specific extensions or the target-dependent standard types. 196compiler-specific extensions or target-dependent standard types.
197E.g. <tt>char</tt> differs in signedness and <tt>long</tt> differs in 197E.g. <tt>char</tt> differs in signedness and <tt>long</tt> differs in
198size, depending on the target architecture and platform ABI. 198size, depending on the target architecture and platform ABI.
199</p> 199</p>
@@ -660,12 +660,18 @@ initialization. The JIT compiler benefits from this fact when applying
660certain optimizations. 660certain optimizations.
661</p> 661</p>
662<p> 662<p>
663As a consequence of this, the <em>elements</em> of complex numbers and 663As a consequence, the <em>elements</em> of complex numbers and
664vectors are immutable. But the elements of an aggregate holding these 664vectors are immutable. But the elements of an aggregate holding these
665types <em>may</em> be modified of course. I.e. you cannot assign to 665types <em>may</em> be modified of course. I.e. you cannot assign to
666<tt>foo.c.im</tt>, but you can assign a (newly created) complex number 666<tt>foo.c.im</tt>, but you can assign a (newly created) complex number
667to <tt>foo.c</tt>. 667to <tt>foo.c</tt>.
668</p> 668</p>
669<p>
670The JIT compiler implements strict aliasing rules: accesses to different
671types do <b>not</b> alias, except for differences in signedness (this
672applies even to <tt>char</tt> pointers, unlike C99). Type punning
673through unions is explicitly detected and allowed.
674</p>
669 675
670<h3 id="cdata_call">Calling a cdata object</h3> 676<h3 id="cdata_call">Calling a cdata object</h3>
671<ul> 677<ul>