Reorganize the struct RException::mesg member

There is no need to limit the type to `struct RString`.
Also, the `MRB_EXC_MESG_STRING_FLAG` flag can be eliminated by checking if `struct RException::mesg` is `NULL` or not.

ref. #2485
This commit is contained in:
dearblue
2022-03-13 15:20:12 +09:00
parent a2e9005286
commit 7d85092bc4
3 changed files with 9 additions and 15 deletions
+1 -2
View File
@@ -17,11 +17,10 @@ MRB_BEGIN_DECL
struct RException {
MRB_OBJECT_HEADER;
struct iv_tbl *iv;
struct RString *mesg;
struct RObject *mesg; // NULL or probably RString
};
#define mrb_exc_ptr(v) ((struct RException*)mrb_ptr(v))
#define MRB_EXC_MESG_STRING_FLAG 0x100
MRB_API void mrb_sys_fail(mrb_state *mrb, const char *mesg);
MRB_API mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str);