The Supreme Court had previously declined to block the law but didn't rule on its constitutionality.