diff options
| author | Helmut Eller | 2026-02-20 13:50:09 +0100 |
|---|---|---|
| committer | Helmut Eller | 2026-02-20 13:50:09 +0100 |
| commit | 3ed4886fe6daa3fae172cb710bf939bc9d2ac4e2 (patch) | |
| tree | dfdf10f06d214c6f9b473ef9d15d8f56ef53bb14 | |
| parent | 1cb0262ce86f2c7432a357ecdf5a95eaba20650e (diff) | |
| download | emacs-feature/igc2.tar.gz emacs-feature/igc2.zip | |
Add some assertionsfeature/igc2
* src./igc.c (igc_header_type, igc_header_hash, igc_header_nwords):
Check the tag in the non-exthdr case.
| -rw-r--r-- | src/igc.c | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -635,6 +635,7 @@ igc_header_type (union igc_header *h) | |||
| 635 | { | 635 | { |
| 636 | if (header_tag (h) == IGC_TAG_EXTHDR) | 636 | if (header_tag (h) == IGC_TAG_EXTHDR) |
| 637 | return header_exthdr (h)->obj_type; | 637 | return header_exthdr (h)->obj_type; |
| 638 | igc_assert (header_tag (h) == IGC_TAG_OBJ); | ||
| 638 | return header_type (h); | 639 | return header_type (h); |
| 639 | } | 640 | } |
| 640 | 641 | ||
| @@ -643,6 +644,7 @@ igc_header_hash (union igc_header *h) | |||
| 643 | { | 644 | { |
| 644 | if (header_tag (h) == IGC_TAG_EXTHDR) | 645 | if (header_tag (h) == IGC_TAG_EXTHDR) |
| 645 | return header_exthdr (h)->hash; | 646 | return header_exthdr (h)->hash; |
| 647 | igc_assert (header_tag (h) == IGC_TAG_OBJ); | ||
| 646 | return header_hash (h); | 648 | return header_hash (h); |
| 647 | } | 649 | } |
| 648 | 650 | ||
| @@ -651,6 +653,7 @@ igc_header_nwords (const union igc_header *h) | |||
| 651 | { | 653 | { |
| 652 | if (header_tag (h) == IGC_TAG_EXTHDR) | 654 | if (header_tag (h) == IGC_TAG_EXTHDR) |
| 653 | return header_exthdr (h)->nwords; | 655 | return header_exthdr (h)->nwords; |
| 656 | igc_assert (header_tag (h) == IGC_TAG_OBJ); | ||
| 654 | return header_nwords (h); | 657 | return header_nwords (h); |
| 655 | } | 658 | } |
| 656 | 659 | ||