Reachable classes should work on external classes
Reachable classes should work on external classes

Summary:
This is an old piece of code that might be problematic when external classes are present in scope.

`auto const& cls : scope` takes out a const reference to a `DexClass*`
`auto& m : cls->get_dmethods()` asks for a non-const reference to a `DexMethod*`. In this case it called the non-const version of `get_dmethods()`, which aborts if `cls` is external.

I am hitting a crash here and I don't think this is right. After making this change this crash goes away because the const version of `get_dmethods()` will be used.

Reviewed By: int3

Differential Revision: D22715461

fbshipit-source-id: 82a2f1045d3bc7371d5dee352d202ec40c48d79d

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex