File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ type error =
124
124
| Probe_format
125
125
| Probe_name_too_long of string
126
126
| Probe_name_format of string
127
+ | Probe_name_undefined of string
127
128
| Probe_is_enabled_format
128
129
| Literal_overflow of string
129
130
| Unknown_literal of string * char
@@ -3752,6 +3753,10 @@ and type_expect_
3752
3753
_ } ,
3753
3754
_)}]) ->
3754
3755
check_probe_name name name_loc env;
3756
+ add_delayed_check
3757
+ (fun () ->
3758
+ if not (Env. has_probe name) then
3759
+ raise(Error (name_loc, env, (Probe_name_undefined name))));
3755
3760
rue {
3756
3761
exp_desc = Texp_probe_is_enabled {name};
3757
3762
exp_loc = loc; exp_extra = [] ;
@@ -5601,6 +5606,11 @@ let report_error ~loc env = function
5601
5606
Probe names may only contain alphanumeric characters or \
5602
5607
underscores."
5603
5608
name
5609
+ | Probe_name_undefined name ->
5610
+ Location. errorf ~loc
5611
+ " Undefined probe name `%s' used in %%probe_is_enabled. \
5612
+ Not found [%%probe \" %s\" ...] in the same compilation unit."
5613
+ name name
5604
5614
| Probe_format ->
5605
5615
Location. errorf ~loc
5606
5616
" Probe points must consist of a name, as a string \
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ type error =
181
181
| Probe_format
182
182
| Probe_name_too_long of string
183
183
| Probe_name_format of string
184
+ | Probe_name_undefined of string
184
185
(* CR-soon mshinwell: Use an inlined record *)
185
186
| Probe_is_enabled_format
186
187
| Literal_overflow of string
You can’t perform that action at this time.
0 commit comments