Illegally residing in a country isn't actually a crime you get arrested and thrown in jail for.
Legally speaking, all they can do is deport you. After proving you're illegal. Which would have to occur before a detention. And would require more than "i'm illegal" to occur.