OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 24 matching lines...) Expand all Loading... |
35 mach_msg_type_number_t old_state_count, | 35 mach_msg_type_number_t old_state_count, |
36 thread_state_t new_state, | 36 thread_state_t new_state, |
37 mach_msg_type_number_t* new_state_count) { | 37 mach_msg_type_number_t* new_state_count) { |
38 // This function is similar to 10.9.4 xnu-2422.110.17/osfmk/kern/exception.c | 38 // This function is similar to 10.9.4 xnu-2422.110.17/osfmk/kern/exception.c |
39 // exception_deliver() as far as the delivery logic is concerned. Unlike | 39 // exception_deliver() as far as the delivery logic is concerned. Unlike |
40 // exception_deliver(), this function does not get or set thread states for | 40 // exception_deliver(), this function does not get or set thread states for |
41 // behavior values that require this, as that is left to the caller to do if | 41 // behavior values that require this, as that is left to the caller to do if |
42 // needed. | 42 // needed. |
43 | 43 |
44 std::vector<exception_data_type_t> small_code_vector; | 44 std::vector<exception_data_type_t> small_code_vector; |
45 exception_data_t small_code = NULL; | 45 exception_data_t small_code = nullptr; |
46 if ((behavior & MACH_EXCEPTION_CODES) == 0 && code_count) { | 46 if ((behavior & MACH_EXCEPTION_CODES) == 0 && code_count) { |
47 small_code_vector.reserve(code_count); | 47 small_code_vector.reserve(code_count); |
48 for (size_t code_index = 0; code_index < code_count; ++code_index) { | 48 for (size_t code_index = 0; code_index < code_count; ++code_index) { |
49 small_code_vector[code_index] = code[code_index]; | 49 small_code_vector[code_index] = code[code_index]; |
50 } | 50 } |
51 small_code = &small_code_vector[0]; | 51 small_code = &small_code_vector[0]; |
52 } | 52 } |
53 | 53 |
54 // The *exception_raise*() family has bad declarations. Their code and | 54 // The *exception_raise*() family has bad declarations. Their code and |
55 // old_state arguments aren’t pointers to const data, although they should be. | 55 // old_state arguments aren’t pointers to const data, although they should be. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 new_state, | 121 new_state, |
122 new_state_count); | 122 new_state_count); |
123 | 123 |
124 default: | 124 default: |
125 NOTREACHED(); | 125 NOTREACHED(); |
126 return KERN_INVALID_ARGUMENT; | 126 return KERN_INVALID_ARGUMENT; |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 } // namespace crashpad | 130 } // namespace crashpad |
OLD | NEW |