Compiler crashes with SIGSEGV when using fullSet function with enums
### Nim Version

2.1.9

### Description

The following code crashes the compiler with a SIGSEGV:
```
import std/setutils

type CcsCatType = enum cctNone, cctHeader, cctIndex, cctSetup, cctUnk1, cctStream
const CCS_CAT_TYPES = fullSet(CcsCatType)
proc test(t: int): bool = t.CcsCatType in CCS_CAT_TYPES
discard test(5)
```

### Current Output

```text
int: used config file '/home/charles/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/charles/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]                                                                                         
.........................................................................SIGSEGV: Illegal storage access. (Attempt to read from nil?)
```

### Expected Output

```text
Successful compilation.
```

### Known Workarounds

_No response_

### Additional Information

_No response_