A law cannot overturn the Constitution, you need an Amendment for that. In principle, anyway. If you have a Supreme Court that abdicates its duties then you can do whatever you want, at the cost of legitimacy.
The nuances of criminal procedure may not apply, but the fundamental constitutional rights still do, as well as human rights. Indeterminate detention violates both.