From c16c9781939eb8cf175ae82b647c86ed7ea1d767 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Sat, 24 Mar 2012 12:28:43 -0700 Subject: Updated DynASM from upstream (Lua 5.2 support). --- dynasm/dynasm.lua | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'dynasm/dynasm.lua') diff --git a/dynasm/dynasm.lua b/dynasm/dynasm.lua index da94744..2ef8164 100644 --- a/dynasm/dynasm.lua +++ b/dynasm/dynasm.lua @@ -2,7 +2,7 @@ -- DynASM. A dynamic assembler for code generation engines. -- Originally designed and implemented for LuaJIT. -- --- Copyright (C) 2005-2011 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2012 Mike Pall. All rights reserved. -- See below for full copyright notice. ------------------------------------------------------------------------------ @@ -10,14 +10,14 @@ local _info = { name = "DynASM", description = "A dynamic assembler for code generation engines", - version = "1.2.2", - vernum = 10202, - release = "2011-01-09", + version = "1.3.0", + vernum = 10300, + release = "2011-05-05", author = "Mike Pall", url = "http://luajit.org/dynasm.html", license = "MIT", copyright = [[ -Copyright (C) 2005-2011 Mike Pall. All rights reserved. +Copyright (C) 2005-2012 Mike Pall. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -259,9 +259,17 @@ local condstack = {} -- Evaluate condition with a Lua expression. Substitutions already performed. local function cond_eval(cond) - local func, err = loadstring("return "..cond) + local func, err + if setfenv then + func, err = loadstring("return "..cond, "=expr") + else + -- No globals. All unknown identifiers evaluate to nil. + func, err = load("return "..cond, "=expr", "t", {}) + end if func then - setfenv(func, {}) -- No globals. All unknown identifiers evaluate to nil. + if setfenv then + setfenv(func, {}) -- No globals. All unknown identifiers evaluate to nil. + end local ok, res = pcall(func) if ok then if res == 0 then return false end -- Oh well. @@ -390,7 +398,7 @@ map_coreop[".macro_*"] = function(mparams) -- Split off and validate macro name. local name = remove(mparams, 1) if not name then werror("missing macro name") end - if not (match(name, "^[%a_][%w_%.]*$") or match(name, "^%.[%w_%.]+$")) then + if not (match(name, "^[%a_][%w_%.]*$") or match(name, "^%.[%w_%.]*$")) then wfatal("bad macro name `"..name.."'") end -- Validate macro parameter names. -- cgit v1.2.3