I'm not sure, but it may be the same as ex post facto. So no they broke the law when it was illegal and they still would need to finish their sentence. But I'm not sure.
Wondering if or when weed is legalized in the USA, does that mean that the people still serving time for it get to be released? Because that would suck if they didn't.