MCPcopy Create free account
hub / github.com/anjo76/angelscript / ValidateByteCode

Function ValidateByteCode

sdk/tests/test_feature/source/utils.cpp:337–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337bool ValidateByteCode(asIScriptFunction *func, asBYTE *expect)
338{
339 if (func == 0) return false;
340 asUINT len;
341 asDWORD *bc = func->GetByteCode(&len);
342 for( asUINT n = 0, i = 0; n < len; )
343 {
344 asBYTE c = *(asBYTE*)(&bc[n]);
345 if( c != expect[i] )
346 return false;
347 n += asBCTypeSize[asBCInfo[c].type];
348
349 if( expect[i++] == asBC_RET && n < len )
350 return false;
351 }
352
353 return true;
354}
355
356string GetCurrentDir()
357{

Callers 9

test_compiler.cppFile · 0.85
TestOptimizeFunction · 0.85
test_condition.cppFile · 0.85
TestFunction · 0.85
TestFunction · 0.85
TestFunction · 0.85
TestFunction · 0.85

Calls 1

GetByteCodeMethod · 0.80

Tested by

no test coverage detected