py/emitnative: Add check that RHS of viper store is of integral type.
This commit is contained in:
parent
94e4bd456f
commit
9598f36a84
@ -1698,6 +1698,10 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
|
|||||||
#else
|
#else
|
||||||
emit_pre_pop_reg_flexible(emit, &vtype_value, ®_value, reg_base, reg_index);
|
emit_pre_pop_reg_flexible(emit, &vtype_value, ®_value, reg_base, reg_index);
|
||||||
#endif
|
#endif
|
||||||
|
if (vtype_value != VTYPE_BOOL && vtype_value != VTYPE_INT && vtype_value != VTYPE_UINT) {
|
||||||
|
EMIT_NATIVE_VIPER_TYPE_ERROR(emit,
|
||||||
|
"can't store '%q'", vtype_to_qstr(vtype_value));
|
||||||
|
}
|
||||||
switch (vtype_base) {
|
switch (vtype_base) {
|
||||||
case VTYPE_PTR8: {
|
case VTYPE_PTR8: {
|
||||||
// pointer to 8-bit memory
|
// pointer to 8-bit memory
|
||||||
@ -1784,6 +1788,10 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
|
|||||||
#else
|
#else
|
||||||
emit_pre_pop_reg_flexible(emit, &vtype_value, ®_value, REG_ARG_1, reg_index);
|
emit_pre_pop_reg_flexible(emit, &vtype_value, ®_value, REG_ARG_1, reg_index);
|
||||||
#endif
|
#endif
|
||||||
|
if (vtype_value != VTYPE_BOOL && vtype_value != VTYPE_INT && vtype_value != VTYPE_UINT) {
|
||||||
|
EMIT_NATIVE_VIPER_TYPE_ERROR(emit,
|
||||||
|
"can't store '%q'", vtype_to_qstr(vtype_value));
|
||||||
|
}
|
||||||
switch (vtype_base) {
|
switch (vtype_base) {
|
||||||
case VTYPE_PTR8: {
|
case VTYPE_PTR8: {
|
||||||
// pointer to 8-bit memory
|
// pointer to 8-bit memory
|
||||||
|
Loading…
Reference in New Issue
Block a user