mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-07 06:18:42 +00:00
be a bit more forgiving in eval interpreter, to allow for graceful type (and thus empty bytecode) evaluation
This commit is contained in:
+1
-6
@@ -5349,15 +5349,10 @@ e_interpret(String8 bytecode)
|
|||||||
}
|
}
|
||||||
done:;
|
done:;
|
||||||
|
|
||||||
if(stack_count == 1)
|
if(stack_count >= 1)
|
||||||
{
|
{
|
||||||
result.value = stack[0];
|
result.value = stack[0];
|
||||||
}
|
}
|
||||||
else if(result.code == E_InterpretationCode_Good)
|
|
||||||
{
|
|
||||||
result.code = E_InterpretationCode_MalformedBytecode;
|
|
||||||
}
|
|
||||||
|
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,15 @@
|
|||||||
# define thread_var __thread
|
# define thread_var __thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct OnlyInModule OnlyInModule;
|
||||||
|
struct OnlyInModule
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
char *name;
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct Basics Basics;
|
typedef struct Basics Basics;
|
||||||
struct Basics
|
struct Basics
|
||||||
{
|
{
|
||||||
@@ -37,6 +46,7 @@ dll_type_eval_tests(void)
|
|||||||
{
|
{
|
||||||
Basics basics1 = {1, 2, 3, 4};
|
Basics basics1 = {1, 2, 3, 4};
|
||||||
Basics basics2 = {4, 5, 6, 7};
|
Basics basics2 = {4, 5, 6, 7};
|
||||||
|
OnlyInModule only_in_module = {123, 456, 789, "this type is only in the module!"};
|
||||||
int x = 0;
|
int x = 0;
|
||||||
(void)x;
|
(void)x;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user