MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / CheckShortyDescriptorMatch

Method CheckShortyDescriptorMatch

Bcore/src/main/cpp/dex/dex_file_verifier.cc:241–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241bool DexFileVerifier::CheckShortyDescriptorMatch(char shorty_char, const char* descriptor,
242 bool is_return_type) {
243 switch (shorty_char) {
244 case 'V':
245 if (UNLIKELY(!is_return_type)) {
246 ErrorStringPrintf("Invalid use of void");
247 return false;
248 }
249 FALLTHROUGH_INTENDED;
250 case 'B':
251 case 'C':
252 case 'D':
253 case 'F':
254 case 'I':
255 case 'J':
256 case 'S':
257 case 'Z':
258 if (UNLIKELY((descriptor[0] != shorty_char) || (descriptor[1] != '\0'))) {
259 ErrorStringPrintf("Shorty vs. primitive type mismatch: '%c', '%s'",
260 shorty_char, descriptor);
261 return false;
262 }
263 break;
264 case 'L':
265 if (UNLIKELY((descriptor[0] != 'L') && (descriptor[0] != '['))) {
266 ErrorStringPrintf("Shorty vs. type mismatch: '%c', '%s'", shorty_char, descriptor);
267 return false;
268 }
269 break;
270 default:
271 ErrorStringPrintf("Bad shorty character: '%c'", shorty_char);
272 return false;
273 }
274 return true;
275}
276
277bool DexFileVerifier::CheckListSize(const void* start, size_t count, size_t elem_size,
278 const char* label) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected