fixed loading of both dasm_x64 and dasm_x86 in the same luastate (luapower needs this for checking dependencies)

This commit is contained in:
Cosmin Apreutesei
2018-07-07 22:54:31 +03:00
parent eba02fcf52
commit 3c66fd1f76
3 changed files with 2417 additions and 2416 deletions
+9 -20
View File
@@ -1,22 +1,11 @@
------------------------------------------------------------------------------
-- DynASM x64 module.
--
-- Copyright (C) 2005-2015 Mike Pall. All rights reserved.
-- See dynasm.lua for full copyright notice.
------------------------------------------------------------------------------
-- This module just sets 64 bit mode for the combined x86/x64 module.
-- All the interesting stuff is there.
------------------------------------------------------------------------------
--unload dasm_x86 if it's already loaded.
-- DynASM x64 loader module.
--unload dasm_x86x64 if it's already loaded.
if not package then package = {loaded = {}} end --for compat. with minilua
local dasm_x86 = package.loaded.dasm_x86
package.loaded.dasm_x86 = nil
x64 = true -- Using a global is an ugly, but effective solution.
local dasm_x64 = require("dasm_x86")
package.loaded.dasm_x86 = dasm_x86 --put it back
return dasm_x64
package.loaded.dasm_x86x64 = nil
dasm_x64 = true -- Using a global is an ugly, but effective solution.
local dasm = require'dasm_x86x64'
dasm_x64 = nil
package.loaded.dasm_x86x64 = true
return dasm
+9 -2396
View File
File diff suppressed because it is too large Load Diff
+2399
View File
File diff suppressed because it is too large Load Diff