|
| 01 Aug 2015 07:25 PM |
For some reason this code returns a stack overflow:
unwrap = function(...) local r = {}; for k,v in next,{...} do table.insert(r, pcall(function() if not rawget(v, "_Real") then error() end end) and v._Real or v) end return unpack(r); end
Does anyone know why? |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2015 07:29 PM |
Dont you lock your metatable when you wrap userdatas? Meh. Anyway
WTF is this
table.insert(r, pcall(function() if not rawget(v, "_Real") then error() end end) and v._Real or v)
wut ru doing.
how r u wrapping this. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2015 07:30 PM |
I would need to pm you the code, I am not comfortable saying it on here.
One second. |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2015 07:57 PM |
'return unpack(r);' Hmm, I wonder why... |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Aug 2015 07:58 PM |
| You probably want to add 'if #r > 0 then' |
|
|
| Report Abuse |
|
|