Robert Downey Jr. showed up in court today to support his son Indio who pled guilty to drug charges -- but he could have a clean record in no time at all ... and the judge used Iron Man as inspiration.
Judge Keith Schwartz made a point of acknowledging Indio's famous dad by saying, "I know in life people always look up to superheroes, but I think you might have contact or an inside as to one superhero -- that's Iron Man."
Indio pled guilty to felony cocaine possession -- but the judge said the conviction will be wiped clean if Indio stays clean and sober for 18 months and finishes his program.
Indio is prohibited from being around anyone who sells, buys or uses drugs.
The courtroom scene was moving ... As Indio and his lawyer, Blair Berk, faced the judge, Robert -- who has his own history with drug addiction which he has kicked in breathtaking form -- watched attentively.