-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Hello,
While reading the state machine in src/operations.c I am wondering how this code works:
ledger-app-tezos/src/operations.c
Lines 199 to 213 in 58797b2
| switch (state->address_step) { | |
| case 2: | |
| // Need 1 byte for signature, plus the rest of the hash. | |
| if (state->addr_length != HASH_SIZE + 1) { | |
| PARSE_ERROR(); | |
| } | |
| CALL_SUBPARSER(parse_next_type, byte, &(state->subsub_state), sizeof(state->signature_type)); | |
| memcpy(&(state->signature_type), &(state->subsub_state.body), sizeof(state->signature_type)); | |
| case 3: | |
| CALL_SUBPARSER(parse_next_type, byte, &(state->subsub_state), sizeof(state->key_hash)); | |
| memcpy(&(state->key_hash), &(state->subsub_state.body), sizeof(state->key_hash)); |
More precisely after case 0: ... state->address_step=1; and case 1: ... state->address_step=2;, why is there no state->address_step=3; on line 209, at the end of case 2:? The case block "falls through" into case 3 and then the function returns in CALL_SUBPARSER (line 212). When I add some printf statements in this function to analyze where the flow goes, it seems that the "subparsing" goes back to line 207 instead of line 212 and that the code in lines 213-215 is never executed. Did I understand the code correctly or did I miss something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels