Compiled program segfault bugfix

This commit is contained in:
IntelliJ User 2019-08-21 18:47:25 +03:00
parent a24866cc6f
commit 99f6357ccd

View file

@ -316,13 +316,16 @@ extern void* Bsexp (int n, ...) {
extern int Btag (void *d, int t, int n) { extern int Btag (void *d, int t, int n) {
data *r = (data *) BOX (NULL); data *r = (data *) BOX (NULL);
r = TO_DATA(d); if (UNBOXED(d)) return BOX(0);
else {
r = TO_DATA(d);
#ifndef DEBUG_PRINT #ifndef DEBUG_PRINT
return BOX(TAG(r->tag) == SEXP_TAG && TO_SEXP(d)->tag == t && LEN(r->tag) == n); return BOX(TAG(r->tag) == SEXP_TAG && TO_SEXP(d)->tag == t && LEN(r->tag) == n);
#else #else
return BOX(TAG(r->tag) == SEXP_TAG && return BOX(TAG(r->tag) == SEXP_TAG &&
GET_SEXP_TAG(TO_SEXP(d)->tag) == t && LEN(r->tag) == n); GET_SEXP_TAG(TO_SEXP(d)->tag) == t && LEN(r->tag) == n);
#endif #endif
}
} }
extern int Barray_patt (void *d, int n) { extern int Barray_patt (void *d, int n) {