diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake
index 072db8269aeeb27f14f0a71a9cbb8291e2bef5b4..10df633d57a1d2edd3eb05301a3baa43b7e3449f 100644
--- a/cmake/luajit.cmake
+++ b/cmake/luajit.cmake
@@ -217,7 +217,6 @@ macro(luajit_build)
         add_definitions(-DLUAJIT_USE_ASAN=1)
         set (luajit_ldflags ${luajit_ldflags} -fsanitize=address)
     endif()
-    add_definitions(-DLUAJIT_ENABLE_PAIRSMM=1)
     add_definitions(-DLUAJIT_SMART_STRINGS=1)
     # Add all COMPILE_DEFINITIONS to xcflags
     get_property(defs DIRECTORY PROPERTY COMPILE_DEFINITIONS)
diff --git a/test/box/gh-4770-broken-pairs-for-space-objects.result b/test/box/gh-4770-broken-pairs-for-space-objects.result
new file mode 100644
index 0000000000000000000000000000000000000000..6ab778d1a4d109690de259d7f334d35ff7d9b224
--- /dev/null
+++ b/test/box/gh-4770-broken-pairs-for-space-objects.result
@@ -0,0 +1,30 @@
+-- test-run result file version 2
+--
+-- gh-4770: Iteration through space with Lua builtin pairs routine
+--
+s = box.schema.create_space('test')
+ | ---
+ | ...
+-- Check whether __pairs is set for the space object, since Lua Fun
+-- handles it manually underneath.
+getmetatable(s).__pairs == s.pairs
+ | ---
+ | - true
+ | ...
+-- Check whether pairs builtin behaviour doesn't change when the
+-- __pairs is set.
+keys = {}
+ | ---
+ | ...
+for k, v in pairs(s) do keys[k] = true end
+ | ---
+ | ...
+keys.name, keys.id, keys.engine
+ | ---
+ | - true
+ | - true
+ | - true
+ | ...
+s:drop()
+ | ---
+ | ...
diff --git a/test/box/gh-4770-broken-pairs-for-space-objects.test.lua b/test/box/gh-4770-broken-pairs-for-space-objects.test.lua
new file mode 100644
index 0000000000000000000000000000000000000000..8c36bd3050704d6e87a94354203e89cdbc829675
--- /dev/null
+++ b/test/box/gh-4770-broken-pairs-for-space-objects.test.lua
@@ -0,0 +1,13 @@
+--
+-- gh-4770: Iteration through space with Lua builtin pairs routine
+--
+s = box.schema.create_space('test')
+-- Check whether __pairs is set for the space object, since Lua Fun
+-- handles it manually underneath.
+getmetatable(s).__pairs == s.pairs
+-- Check whether pairs builtin behaviour doesn't change when the
+-- __pairs is set.
+keys = {}
+for k, v in pairs(s) do keys[k] = true end
+keys.name, keys.id, keys.engine
+s:drop()