decompals / ido-static-recomp

IDO static recomp
43 stars 10 forks source link

Replace `std::map` `[]` uses with `.at` #54

Closed AngheloAlf closed 1 year ago

AngheloAlf commented 1 year ago

The [] operator from the std::map class adds an element if the key is not present in the map, which is errorprone (I had issues with this when trying to add ld support to recomp), so I changed every use I could find to an .at, which doesn't add values if it doesn't find the key inside the map and does boundary checking, so problems can be catched earlier.

The only real change I made was in inspect_data_function_pointers.