diff options
| -rw-r--r-- | xmake/core/base/interpreter.lua | 5 | ||||
| -rw-r--r-- | xmake/core/base/scopeinfo.lua | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index e4d6c3046..dfefe3438 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -1271,7 +1271,10 @@ function interpreter:api_register_add_groups(scope_kind, ...) values = table.join(table.unpack(values)) -- save values - scope[name] = scope[name] or {} + -- + -- @note maybe scope[name] has been unwrapped, we need wrap it first + -- https://github.com/xmake-io/xmake/issues/4428 + scope[name] = table.wrap(scope[name]) table.wrap_lock(values) table.insert(scope[name], values) diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua index 68d87706b..a7bbb4a19 100644 --- a/xmake/core/base/scopeinfo.lua +++ b/xmake/core/base/scopeinfo.lua @@ -239,7 +239,10 @@ function _instance:_api_add_groups(name, ...) values = table.join(table.unpack(values)) -- save values - scope[name] = scope[name] or {} + -- + -- @note maybe scope[name] has been unwrapped, we need wrap it first + -- https://github.com/xmake-io/xmake/issues/4428 + scope[name] = table.wrap(scope[name]) table.wrap_lock(values) table.insert(scope[name], values) scope[name] = self:_api_handle(name, scope[name]) |
