Imprecise `assert` in subtype.c?


#1
typedef struct {
    int depth;
    int more;
    uint32_t stack[100];  // stack of bits represented as a bit vector
} jl_unionstate_t;

// ...

static int statestack_get(jl_unionstate_t *st, int i)
{
    assert(i >= 0 && i < sizeof(st->stack) * 8);

I wonder if * 8 should really be * 4 because of uint32_t type of stack elements? File an issue?


#2

This is correct. i is a bit index, sizeof is size in bytes and 8 is bits per bytes.


#3

My bad. Thank you.


#4

It was a good question though. :slight_smile: