Imprecise `assert` in subtype.c?

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?

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

1 Like

My bad. Thank you.

It was a good question though. :slight_smile: