| 36 | } |
| 37 | } |
| 38 | void DependencySolver::solveStructDependency() { |
| 39 | string structName = dependency["name"].asString(); |
| 40 | FUZZER_LOGI("Dependent structure name: %s.", structName.c_str()); |
| 41 | if (parcelableStructureReplyInfo.count(structName) == 0) { |
| 42 | FUZZER_LOGE("Structure %s does not exist.", structName.c_str()); |
| 43 | exit(0); |
| 44 | } |
| 45 | |
| 46 | Json::Value structure = parcelableStructureReplyInfo[structName]; |
| 47 | |
| 48 | // get the tx that this structure depends. |
| 49 | Json::Value txDependency = structure["dependency"]; |
| 50 | Parcel tmp; |
| 51 | DependencySolver solver(&tmp, COMMON_DEPENDENCY, txDependency); |
| 52 | // read target structure to tmp parcel. |
| 53 | solver.solve(); |
| 54 | tmp.setDataPosition(0); |
| 55 | |
| 56 | // read target structure item. |
| 57 | uint32_t possIdx = dependency["possIdx"].asUInt(); |
| 58 | |
| 59 | Json::Value &info = structure["possibility"][possIdx]; |
| 60 | Json::Value &variable = structure["variable"]; |
| 61 | Json::Value &loop = structure["loop"]; |
| 62 | Json::Value &constraint = structure["constraint"]; |
| 63 | |
| 64 | ParcelReaderWriter parcelReaderWriter(info["reply"], variable, loop, |
| 65 | constraint); |
| 66 | parcelReaderWriter.initParcelableStructRead(&tmp); |
| 67 | parcelReaderWriter.prepareDependencyRead( |
| 68 | info["reply"], dependency["varIdx"].asUInt(), targetParcel); |
| 69 | parcelReaderWriter.start(); |
| 70 | |
| 71 | return; |
| 72 | } |
| 73 | void DependencySolver::solveTxDependency() { |
| 74 | |
| 75 | string txName = dependency["name"].asString(); |
nothing calls this directly
no test coverage detected