diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-09-13 09:14:20 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-13 13:40:46 +0000 |
commit | f9898b9ecab9851f32e1b3aad1176c801150f975 (patch) | |
tree | 47b955ac228ee28c135f775ce6f66ff6c5b8c0b9 /yarp | |
parent | ea75a682a9adfac1723308a1c032b7d9b68ffcb6 (diff) |
[ruby/yarp] Better handle invalid gvar writes
https://github.com/ruby/yarp/commit/eaaebc17c8
Diffstat (limited to 'yarp')
-rw-r--r-- | yarp/yarp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/yarp/yarp.c b/yarp/yarp.c index c7dcf482f7..78747682cb 100644 --- a/yarp/yarp.c +++ b/yarp/yarp.c @@ -8136,12 +8136,9 @@ parse_target(yp_parser_t *parser, yp_node_t *target) { target->type = YP_CONSTANT_TARGET_NODE; return target; case YP_BACK_REFERENCE_READ_NODE: - assert(sizeof(yp_global_variable_target_node_t) == sizeof(yp_back_reference_read_node_t)); - /* fallthrough */ case YP_NUMBERED_REFERENCE_READ_NODE: - assert(sizeof(yp_global_variable_target_node_t) == sizeof(yp_numbered_reference_read_node_t)); yp_diagnostic_list_append(&parser->error_list, target->location.start, target->location.end, YP_ERR_WRITE_TARGET_READONLY); - /* fallthrough */ + return target; case YP_GLOBAL_VARIABLE_READ_NODE: assert(sizeof(yp_global_variable_target_node_t) == sizeof(yp_global_variable_read_node_t)); target->type = YP_GLOBAL_VARIABLE_TARGET_NODE; |