Commit ee06bbb
vm.c: replace type assertions with runtime checks
Replace mrb_assert with mrb_ensure_*_type for VM opcodes that require
specific types:
- OP_ARYCAT: mrb_ensure_array_type
- OP_ARYPUSH: mrb_ensure_array_type
- OP_ASET: mrb_ensure_array_type (also fixed: was checking wrong register)
- OP_INTERN: mrb_ensure_string_type
- OP_HASHCAT: mrb_ensure_hash_type
These checks catch codegen bugs with clear error messages in both
debug and release builds.
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6b482ee commit ee06bbb
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3003 | 3003 | | |
3004 | 3004 | | |
3005 | 3005 | | |
3006 | | - | |
| 3006 | + | |
3007 | 3007 | | |
3008 | 3008 | | |
3009 | 3009 | | |
3010 | 3010 | | |
3011 | 3011 | | |
3012 | 3012 | | |
3013 | 3013 | | |
3014 | | - | |
| 3014 | + | |
3015 | 3015 | | |
3016 | 3016 | | |
3017 | 3017 | | |
| |||
3045 | 3045 | | |
3046 | 3046 | | |
3047 | 3047 | | |
3048 | | - | |
| 3048 | + | |
3049 | 3049 | | |
3050 | 3050 | | |
3051 | 3051 | | |
| |||
3085 | 3085 | | |
3086 | 3086 | | |
3087 | 3087 | | |
3088 | | - | |
| 3088 | + | |
3089 | 3089 | | |
3090 | 3090 | | |
3091 | 3091 | | |
| |||
3158 | 3158 | | |
3159 | 3159 | | |
3160 | 3160 | | |
3161 | | - | |
| 3161 | + | |
3162 | 3162 | | |
3163 | 3163 | | |
3164 | 3164 | | |
| |||
0 commit comments