Skip to content

Commit 3c66fd1

Browse files
committed
fixed loading of both dasm_x64 and dasm_x86 in the same luastate (luapower needs this for checking dependencies)
1 parent eba02fc commit 3c66fd1

File tree

3 files changed

+2417
-2416
lines changed

3 files changed

+2417
-2416
lines changed

dasm_x64.lua

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
------------------------------------------------------------------------------
2-
-- DynASM x64 module.
3-
--
4-
-- Copyright (C) 2005-2015 Mike Pall. All rights reserved.
5-
-- See dynasm.lua for full copyright notice.
6-
------------------------------------------------------------------------------
7-
-- This module just sets 64 bit mode for the combined x86/x64 module.
8-
-- All the interesting stuff is there.
9-
------------------------------------------------------------------------------
101

11-
--unload dasm_x86 if it's already loaded.
12-
if not package then package = {loaded = {}} end --for compat. with minilua
13-
local dasm_x86 = package.loaded.dasm_x86
14-
package.loaded.dasm_x86 = nil
15-
16-
x64 = true -- Using a global is an ugly, but effective solution.
17-
local dasm_x64 = require("dasm_x86")
18-
19-
package.loaded.dasm_x86 = dasm_x86 --put it back
20-
21-
return dasm_x64
2+
-- DynASM x64 loader module.
223

4+
--unload dasm_x86x64 if it's already loaded.
5+
if not package then package = {loaded = {}} end --for compat. with minilua
6+
package.loaded.dasm_x86x64 = nil
7+
dasm_x64 = true -- Using a global is an ugly, but effective solution.
8+
local dasm = require'dasm_x86x64'
9+
dasm_x64 = nil
10+
package.loaded.dasm_x86x64 = true
11+
return dasm

0 commit comments

Comments
 (0)