[Asterisk-code-review] Test cel: Fails when DONT OPTIMIZE is off (asterisk[16])
Chris Savinovich
asteriskteam at digium.com
Sat Jan 19 16:11:00 CST 2019
Chris Savinovich has uploaded this change for review. ( https://gerrit.asterisk.org/10889
Change subject: Test_cel: Fails when DONT_OPTIMIZE is off
......................................................................
Test_cel: Fails when DONT_OPTIMIZE is off
A bug in GCC causes TEST_CEL to return
failure under the following conditions:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. Test name: test_cel_dial_pickup
The bug affects arithmetic calculations when
the optimization level is bigger than O1 and the
-fpartial-inline flag is on. Provided these
conditions, function ast_str_to_lower() fails to
convert to lower case due to said function being
of type force_inline. The simple solution has
been to write a short loop that converts the
variable to lower case instead of calling function
ast_str_to_lower()
Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7
---
M main/cel.c
1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/89/10889/1
diff --git a/main/cel.c b/main/cel.c
index feb3bee..f9c5cb9 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -497,13 +497,20 @@
{
RAII_VAR(struct cel_config *, cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
RAII_VAR(char *, app, NULL, ao2_cleanup);
- char *app_lower;
+ char *app_lower, *str;
if (!cfg || !cfg->general) {
return 0;
}
- app_lower = ast_str_to_lower(ast_strdupa(const_app));
+ app_lower = ast_strdupa(const_app);
+ str = app_lower;
+ for (; *str; ++str) {
+ if ((*str >= 'A') && (*str <= 'Z')) {
+ *str += 32;
+ }
+ }
+
app = ao2_find(cfg->general->apps, app_lower, OBJ_SEARCH_KEY);
if (!app) {
return 0;
--
To view, visit https://gerrit.asterisk.org/10889
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7
Gerrit-Change-Number: 10889
Gerrit-PatchSet: 1
Gerrit-Owner: Chris Savinovich <csavinovich at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190119/ffb3d7b0/attachment.html>
More information about the asterisk-code-review
mailing list