fixed: in BaseExpression::put_field_value_list_model() model_env_local.model pointer was not set to the child object

reported by clang with -fsanitize=undefined
main.cpp:55:63: runtime error: member access within address 0x614000000040 which does not point to an object of type 'Krolik'
0x614000000040: note: object is of type 'Item'
 02 00 00 73  00 4e 75 00 00 00 00 00  a0 b9 ff ff ff 7f 00 00  c0 80 ff ff ff 7f 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Item'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.cpp:55:63 in
main.cpp:55:97: runtime error: member access within address 0x614000000040 which does not point to an object of type 'Krolik'
0x614000000040: note: object is of type 'Item'
 02 00 00 73  00 4e 75 00 00 00 00 00  a0 b9 ff ff ff 7f 00 00  c0 80 ff ff ff 7f 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Item'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.cpp:55:97 in
This commit is contained in:
Tomasz Sowa 2021-07-01 22:39:50 +02:00
parent 097c09b9e3
commit 84fd351bfc
2 changed files with 1 additions and 0 deletions

View File

@ -461,6 +461,7 @@ protected:
ModelEnv model_env_local(*model_env);
child_model.model_env = &model_env_local;
child_model.model_env->has_primary_key_set = child_model.get_has_primary_key_set();
child_model.model_env->model = &child_model;
child_model.set_connector(model_connector);
generate_from_model(child_model);