RETURN_OK_WITH_ERROR();
}
if ((size_t)slen > (size_t)(to_dec_end - to_dec)) {
- fr_perror("Internal sanity check failed at %d", __LINE__);
+ fr_perror("%s: Internal sanity check failed at %d", __FUNCTION__, __LINE__);
ASAN_UNPOISON_MEMORY_REGION(to_dec_end, COMMAND_OUTPUT_MAX - slen);
CLEAR_TEST_POINT(cc);
RETURN_COMMAND_ERROR();
break;
default:
- fr_strerror_const("Internal sanity check failed 1");
+ fr_strerror_printf("%s: Internal sanity check failed", __FUNCTION__);
return -1;
}
}
break;
default:
- fr_assert_fail("Internal sanity check failed 2");
+ fr_assert_fail("%s: Internal sanity check failed", __FUNCTION__);
return -1;
}
}
goto add_child;
- }
-
- if (cf_item_is_pair(ci)) {
+ } else if (cf_item_is_pair(ci)) {
char const *attr;
CONF_PAIR *cp = cf_item_to_pair(ci);
}
goto add_child;
- } /* was CONF_PAIR */
-
- cf_log_err(ci, "Internal sanity check failed in unlang compile.");
- talloc_free(c);
- return NULL;
+ } else {
+ cf_log_err(ci, "Asked to compile unknown conf type");
+ talloc_free(c);
+ return NULL;
+ }
add_child:
if (single == UNLANG_IGNORE) continue;
c->number = unlang_number++;
if (!fr_rb_insert(unlang_instruction_tree, c)) {
+ unlang_t *ex = fr_rb_find(unlang_instruction_tree, c);
+ cf_log_err(ci, "Instruction \"%s\" number %i conflicts with \"%s\" number %i",
+ c->debug_name, c->number, ex->debug_name, ex->number);
talloc_free(c);
- cf_log_err(ci, "Internal sanity check failed");
return NULL;
}
/* else it's something like sql { fail = 1 ...} */
goto check_for_module;
- }
-
- if (cf_item_is_pair(ci)) {
+ } else if (cf_item_is_pair(ci)) {
/*
* Else it's a module reference such as "sql", OR
* one of the few bare keywords that we allow.
}
goto check_for_module;
+ } else {
+ cf_log_err(ci, "Asked to compile unknown conf type");
+ return NULL; /* who knows what it is... */
}
- cf_log_err(ci, "Internal sanity check failed in compile_item()");
- return NULL; /* who knows what it is... */
-
check_for_module:
/*
* We now have a name. It can be one of two forms. A
break;
default:
- fr_strerror_const("Internal sanity check failed");
+ fr_strerror_printf("%s: Internal sanity check failed", __FUNCTION__);
return -1;
}
default:
- fr_strerror_const("Internal sanity check failed");
+ fr_strerror_printf("%s: Internal sanity check failed", __FUNCTION__);
return -1;
}