From 515a5f76356ca589814b61c508d976d676c92d94 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 21 Apr 2016 12:56:13 -0700 Subject: [PATCH] fix and deprecate options.offset --- lips/init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lips/init.lua b/lips/init.lua index ca762da..9e823b7 100644 --- a/lips/init.lua +++ b/lips/init.lua @@ -45,6 +45,17 @@ function lips.assemble(fn_or_asm, writer, options) options = options or {} local function main() + if options.offset then + if options.origin or options.base then + error('offset and origin/base options are mutually exclusive') + end + io.stderr:write('Warning: options.offset is deprecated.\n') + options.origin = options.offset + options.base = 0 + else + options.base = options.base or 0x80000000 + end + local fn = nil local asm if fn_or_asm:find('[\r\n]') then @@ -63,8 +74,6 @@ function lips.assemble(fn_or_asm, writer, options) end end - options.base = options.base or 0x80000000 - if options.unsafe then return main() else