hadrian's support for dynamic ways is currently broken (see hadrian#641 ).
The stage 1 GHCs that hadrian produces end up producing bad code for
the iToBase62 function after a few optimisation passes.
In the case where quotRem returns (overflowError, 0),
GHC isn't careful enough to realise q is _|_ and happily inlines,
distributes and floats code around until we end up trying to access
index minBound :: Int of an array of 62 chars, as a result of inlining
the definition of quotRem for Ints, in particular the minBound branch .
I will separately look into reproducing the bad transformation on a small
self-contained example and filling a ticket.