| 459 | } |
| 460 | |
| 461 | static void SetupCyclicTable(lua_State* L) |
| 462 | { |
| 463 | /** |
| 464 | * local x1 = {} |
| 465 | * local x2 = {} |
| 466 | * x1.x2 = x2 |
| 467 | * x2.x1 = x1 |
| 468 | */ |
| 469 | |
| 470 | lua_newtable(L); // x1 |
| 471 | // -1: x1 |
| 472 | |
| 473 | lua_newtable(L); // x2 |
| 474 | // -2: x1 |
| 475 | // -1: x2 |
| 476 | |
| 477 | lua_pushvalue(L, -2); |
| 478 | // -3: x1 |
| 479 | // -2: x2 |
| 480 | // -1: x1 |
| 481 | |
| 482 | lua_setfield(L, -2, "x1"); // x2.x1 = x1 |
| 483 | // -2: x1 |
| 484 | // -1: x2 |
| 485 | |
| 486 | lua_setfield(L, -2, "x2"); // x1.x2 = x2 |
| 487 | // -1: x1 |
| 488 | } |
| 489 | |
| 490 | TEST_F(LuaTableTest, CyclicTable_CheckTableSize) |
| 491 | { |
no test coverage detected