aboutsummaryrefslogtreecommitdiff
path: root/src/deep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/deep.cpp')
-rw-r--r--src/deep.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/deep.cpp b/src/deep.cpp
index d7efe68..5a62000 100644
--- a/src/deep.cpp
+++ b/src/deep.cpp
@@ -351,14 +351,14 @@ int DeepFactory::pushDeepUserdata(DestState L, int nuv_) const
351 DeepPrelude* const prelude{ newDeepObjectInternal(L) }; 351 DeepPrelude* const prelude{ newDeepObjectInternal(L) };
352 if (prelude == nullptr) 352 if (prelude == nullptr)
353 { 353 {
354 return luaL_error( L, "DeepFactory::newDeepObjectInternal failed to create deep userdata (out of memory)"); 354 raise_luaL_error(L, "DeepFactory::newDeepObjectInternal failed to create deep userdata (out of memory)");
355 } 355 }
356 356
357 if (prelude->m_magic != kDeepVersion) 357 if (prelude->m_magic != kDeepVersion)
358 { 358 {
359 // just in case, don't leak the newly allocated deep userdata object 359 // just in case, don't leak the newly allocated deep userdata object
360 deleteDeepObjectInternal(L, prelude); 360 deleteDeepObjectInternal(L, prelude);
361 return luaL_error( L, "Bad Deep Factory: kDeepVersion is incorrect, rebuild your implementation with the latest deep implementation"); 361 raise_luaL_error(L, "Bad Deep Factory: kDeepVersion is incorrect, rebuild your implementation with the latest deep implementation");
362 } 362 }
363 363
364 LUA_ASSERT(L, prelude->m_refcount.load(std::memory_order_relaxed) == 0); // 'DeepFactory::PushDeepProxy' will lift it to 1 364 LUA_ASSERT(L, prelude->m_refcount.load(std::memory_order_relaxed) == 0); // 'DeepFactory::PushDeepProxy' will lift it to 1
@@ -368,13 +368,13 @@ int DeepFactory::pushDeepUserdata(DestState L, int nuv_) const
368 { 368 {
369 // just in case, don't leak the newly allocated deep userdata object 369 // just in case, don't leak the newly allocated deep userdata object
370 deleteDeepObjectInternal(L, prelude); 370 deleteDeepObjectInternal(L, prelude);
371 return luaL_error(L, "Bad DeepFactory::newDeepObjectInternal overload: should not push anything on the stack"); 371 raise_luaL_error(L, "Bad DeepFactory::newDeepObjectInternal overload: should not push anything on the stack");
372 } 372 }
373 373
374 char const* const errmsg{ DeepFactory::PushDeepProxy(L, prelude, nuv_, LookupMode::LaneBody) }; // proxy 374 char const* const errmsg{ DeepFactory::PushDeepProxy(L, prelude, nuv_, LookupMode::LaneBody) }; // proxy
375 if (errmsg != nullptr) 375 if (errmsg != nullptr)
376 { 376 {
377 return luaL_error( L, errmsg); 377 raise_luaL_error(L, errmsg);
378 } 378 }
379 STACK_CHECK( L, 1); 379 STACK_CHECK( L, 1);
380 return 1; 380 return 1;
@@ -443,7 +443,7 @@ DeepPrelude* DeepFactory::toDeep(lua_State* L, int index) const
443 c.L1_i = SourceIndex{ lua_absindex(L1, -1) }; 443 c.L1_i = SourceIndex{ lua_absindex(L1, -1) };
444 if (!c.inter_copy_one()) // u uv 444 if (!c.inter_copy_one()) // u uv
445 { 445 {
446 luaL_error(L1, "Cannot copy upvalue type '%s'", luaL_typename(L1, -1)); // doesn't return 446 raise_luaL_error(L1, "Cannot copy upvalue type '%s'", luaL_typename(L1, -1));
447 } 447 }
448 lua_pop(L1, 1); // ... u [uv]* 448 lua_pop(L1, 1); // ... u [uv]*
449 // this pops the value from the stack 449 // this pops the value from the stack
@@ -459,7 +459,7 @@ DeepPrelude* DeepFactory::toDeep(lua_State* L, int index) const
459 { 459 {
460 // raise the error in the proper state (not the keeper) 460 // raise the error in the proper state (not the keeper)
461 lua_State* const errL{ (mode == LookupMode::FromKeeper) ? L2 : L1 }; 461 lua_State* const errL{ (mode == LookupMode::FromKeeper) ? L2 : L1 };
462 luaL_error(errL, errmsg); // doesn't return 462 raise_luaL_error(errL, errmsg);
463 } 463 }
464 return true; 464 return true;
465} \ No newline at end of file 465} \ No newline at end of file