summaryrefslogtreecommitdiff
path: root/dynasm
diff options
context:
space:
mode:
authorMike Pall <mike>2014-03-06 17:54:48 +0100
committerMike Pall <mike>2014-03-06 17:54:48 +0100
commit80efb077500ca368b26aab0aadcc4e2e877b10ab (patch)
tree7440a974094d400d02536b7091a6f430e4c7bc21 /dynasm
parent416abff90dae9c66e17efe9d6a01efce63eefba8 (diff)
downloadluajit2-80efb077500ca368b26aab0aadcc4e2e877b10ab.tar.gz
DynASM: Emit version check after .arch directive.
Diffstat (limited to 'dynasm')
-rw-r--r--dynasm/dynasm.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/dynasm/dynasm.lua b/dynasm/dynasm.lua
index 2c0970d8..0ea8697c 100644
--- a/dynasm/dynasm.lua
+++ b/dynasm/dynasm.lua
@@ -695,6 +695,9 @@ map_op[".arch_1"] = function(params)
if not params then return "name" end
local err = loadarch(params[1])
if err then wfatal(err) end
+ wline(format("#if DASM_VERSION != %d", _info.vernum))
+ wline('#error "Version mismatch between DynASM and included encoding engine"')
+ wline("#endif")
end
-- Dummy .arch pseudo-opcode to improve the error report.
@@ -877,13 +880,9 @@ local function dasmhead(out)
** DO NOT EDIT! The original file is in "%s".
*/
-#if DASM_VERSION != %d
-#error "Version mismatch between DynASM and included encoding engine"
-#endif
-
]], _info.url,
_info.version, g_arch._info.arch, g_arch._info.version,
- g_fname, _info.vernum))
+ g_fname))
end
-- Read input file.