Browse Source

Merge branch 'master' of https://github.com/albertodemichelis/squirrel

Alberto Demichelis 2 years ago
parent
commit
1c1fd9a370
2 changed files with 9 additions and 2 deletions
  1. 1 1
      doc/source/reference/language/classes.rst
  2. 8 1
      squirrel/sqvm.cpp

+ 1 - 1
doc/source/reference/language/classes.rst

@@ -170,7 +170,7 @@ instead of curly brackets ``{}`` for the attribute declaration to increase reada
 
 
 This means that all rules that apply to tables apply to attributes.
 This means that all rules that apply to tables apply to attributes.
 
 
-Attributes can be retrieved through the built-in function ``classobj.getattributes(membername)`` (see <link linkend="builtin">built-in functions</link>).
+Attributes can be retrieved through the built-in function ``classobj.getattributes(membername)`` (see :ref:`built-in functions <builtin_functions>`).
 and can be modified/added through the built-in function ``classobj.setattributes(membername,val)``.
 and can be modified/added through the built-in function ``classobj.setattributes(membername,val)``.
 
 
 the following code iterates through the attributes of all Foo members.::
 the following code iterates through the attributes of all Foo members.::

+ 8 - 1
squirrel/sqvm.cpp

@@ -715,7 +715,13 @@ bool SQVM::Execute(SQObjectPtr &closure, SQInteger nargs, SQInteger stackbase,SQ
             ci->_root = SQTrue;
             ci->_root = SQTrue;
                       }
                       }
             break;
             break;
-        case ET_RESUME_GENERATOR: _generator(closure)->Resume(this, outres); ci->_root = SQTrue; traps += ci->_etraps; break;
+        case ET_RESUME_GENERATOR: 
+            if(!_generator(closure)->Resume(this, outres)) {
+                return false;
+            }
+            ci->_root = SQTrue;
+            traps += ci->_etraps;
+            break;
         case ET_RESUME_VM:
         case ET_RESUME_VM:
         case ET_RESUME_THROW_VM:
         case ET_RESUME_THROW_VM:
             traps = _suspended_traps;
             traps = _suspended_traps;
@@ -1123,6 +1129,7 @@ exception_trap:
         return false;
         return false;
     }
     }
     assert(0);
     assert(0);
+    return false;
 }
 }
 
 
 bool SQVM::CreateClassInstance(SQClass *theclass, SQObjectPtr &inst, SQObjectPtr &constructor)
 bool SQVM::CreateClassInstance(SQClass *theclass, SQObjectPtr &inst, SQObjectPtr &constructor)