Skip to content

Commit 24bbdea

Browse files
author
Alan Jowett
committed
PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
1 parent 1cf5dad commit 24bbdea

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/asm_syntax.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ struct label_t {
2727
* @brief Construct a new label t object from a string.
2828
*
2929
* @param[in] string_label The string representation of the label.
30+
* @return None (constructor)
3031
*
3132
* @throw std::invalid_argument The label format is invalid.
3233
* @throw std::out_of_range The label value causes numeric overflow.
3334
*
35+
* Format: [prefix/]from[:to]
36+
* - prefix: Optional stack frame prefix
37+
* - from: Source instruction number
38+
* - to: Optional jump target (-1 means next instruction)
39+
*
3440
* Example labels:
3541
* "2:-1" - a label which falls through to the next instruction.
3642
* "2:5" - a label which jumps to instruction 5.
37-
* "2:-1/5:-1" - a label which falls through to the next instruction, with a stack frame prefix denoting where the label was called.
43+
* "2:-1/5:-1" - a label which falls through to the next instruction, with a stack frame prefix denoting where the
44+
* label was called.
3845
*/
3946
explicit label_t(std::string_view string_label) {
4047
auto pos = string_label.find(STACK_FRAME_DELIMITER);

src/crab_verifier.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,10 @@ bool ebpf_check_constraints_at_label(std::ostream& os, const std::string& label_
297297
auto concrete_domain = ebpf_domain_t::from_constraints(constraints, false);
298298

299299
if (concrete_domain.is_bottom()) {
300-
os << "The provided constraints are unsatisfiable (concrete domain is bottom)\n";
301-
os << "Concrete constraints are self-contradictory\n";
300+
os << "The provided constraints are unsatisfiable and self-contradictory (concrete domain is bottom)\n";
302301
os << concrete_domain << "\n";
303302
return false;
304303
}
305-
306304
if (from_inv.is_bottom()) {
307305
os << "The abstract state is unreachable\n";
308306
os << from_inv << "\n";

src/crab_verifier.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ void ebpf_verifier_clear_thread_local_state();
4545
* @param[in] constraints The concrete state to check.
4646
* @retval true The state is valid.
4747
* @retval false The state is invalid.
48-
* @throw std::invalid_argument The label format is invalid
49-
* @throw std::out_of_range The label value causes numeric overflow
48+
*
49+
* Note:
50+
* This can also return false if the label is not found in the CFG or if the label is malformed.
5051
*/
5152
bool ebpf_check_constraints_at_label(std::ostream& os, const std::string& label,
5253
const std::set<std::string>& constraints);

0 commit comments

Comments
 (0)