Bladeren bron

stand-alone interpreter shows incorrect error message when the
'message' is a coroutine (already fixed in 5.2)

Roberto Ierusalimschy 17 jaren geleden
bovenliggende
commit
fdecdd0cec
1 gewijzigde bestanden met toevoegingen van 21 en 0 verwijderingen
  1. 21 0
      bugs

+ 21 - 0
bugs

@@ -1615,6 +1615,27 @@ lapi.c:
 ]],
 }
 
+Bug{
+what = [[stand-alone interpreter shows incorrect error message
+when the "message" is a coroutine]],
+report = [[Patrick Donnelly, on 17/12/2007]],
+since = [[i ]],
+example = [[> error(coroutine.create(function() end))]],
+patch = [[
+lua.c:
+@@ -74,6 +74,8 @@
+ 
+ 
+ static int traceback (lua_State *L) {
++  if (!lua_isstring(L, 1))  /* 'message' not a string? */
++    return 1;  /* keep it intact */
+   lua_getfield(L, LUA_GLOBALSINDEX, "debug");
+   if (!lua_istable(L, -1)) {
+     lua_pop(L, 1);
+
+]],
+}
+
 Bug{
 what = [[ ]],
 report = [[ , on ]],