summaryrefslogtreecommitdiff
path: root/main/ast_expr2.y
AgeCommit message (Collapse)Author
2017-08-01Fix compiler warnings on Fedora 26 / GCC 7.Corey Farrell
GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-07-11ast_expr2: Fix off-nominal memory leak.Richard Mudgett
Thanks to ibercom for pointing out a memory leak that was missed in the earlier patch for the issue. ASTERISK-26119 Reported by: Alexei Gradinari Change-Id: I9a151f5c4725d97fb82a9e938bc73dc659532b71
2016-06-20fix: memory leaks, resource leaks, out of bounds and bugsAlexei Gradinari
ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
2016-06-02Fix #include poll.h and sys/cdefs.hTimo Teräs
POSIX defines poll.h, sys/poll.h should not be used at is c-library internal header which may or may not exist. Notable in musl it generates warning of being incorrect. And add explict include of sys/cdefs.h where needed. Change-Id: I142930df53fe7585a06b854b6faddc5301e024be
2015-05-13MALLOC_DEBUG: Replace WRAP_LIBC_MALLOC with ASTMM_LIBC.Corey Farrell
There are 3 ways that calls directly to standard allocator functions can be dealt with: 1. Block their use, cause them to generate an error. This is the default. 2. Replace them with the Asterisk equivalent function calls. 3. Leave them alone. This change allows one of these 3 options to be selected by any source. The source just needs to define ASTMM_LIBC to ASTMM_BLOCK, ASTMM_REDIRECT, or ASTMM_IGNORE to use option 1, 2 or 3 respectively. Normally ASTMM_BLOCK is the correct option, so it is default when ASTMM_LIBC is not defined. In some cases when building 3rd party code it is desirable to have it use Asterisk functions, without changing the whole source - ASTMM_REDIRECT accomplishes this. When using 3rd party libraries sometimes a static inline function will make use of malloc or free. In these cases it may be unsafe to replace the allocator in the header, as it's possible the memory could be freed by the library using standard allocators. For those cases ASTMM_IGNORE is needed. Change-Id: I8afef4bc7f3b93914263ae27d3a5858b69663fc7
2015-04-29Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE.Corey Farrell
This switches files used to generate other sources to use the new ASTERISK_REGISTER_FILE macro. ASTERISK-25026 #close Reported by: Corey Farrell Change-Id: Ieb2537b83421cad07c8955e5f90c405ccf079740
2014-09-26core: Don't allow free to mean ast_free (and malloc, etc..).Walter Doekes
This gets rid of most old libc free/malloc/realloc and replaces them with ast_free and friends. When compiling with MALLOC_DEBUG you'll notice it when you're mistakenly using one of the libc variants. For the legacy cases you can define WRAP_LIBC_MALLOC before including asterisk.h. Even better would be if the errors were also enabled when compiling without MALLOC_DEBUG, but that's a slightly more invasive header file change. Those compiling addons/format_mp3 will need to rerun ./contrib/scripts/get_mp3_source.sh. ASTERISK-24348 #related Review: https://reviewboard.asterisk.org/r/4015/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24Multiple revisions 360356-360357Russell Bryant
........ r360356 | russell | 2012-03-23 22:33:36 -0400 (Fri, 23 Mar 2012) | 6 lines expression parser: Fix (theoretical) memory leak. Fix a memory leak that is very unlikely to actually happen. If a malloc() succeeded, but the following strdup() failed, the memory from the original malloc() would be leaked. ........ r360357 | russell | 2012-03-23 22:34:39 -0400 (Fri, 23 Mar 2012) | 6 lines Rebuild parsers. This is needed to include the last fix to main/ast_expr2.y. The changes look much bigger as this regeneration of the code was done with newer versions of flex and bison. ........ Merged revisions 360356-360357 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360358 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16Add ABS() absolute value function to the expression parser.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-28Merged revisions 293197 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r293197 | tilghman | 2010-10-28 15:00:06 -0500 (Thu, 28 Oct 2010) | 33 lines Merged revisions 293195-293196 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r293195 | tilghman | 2010-10-28 14:52:52 -0500 (Thu, 28 Oct 2010) | 12 lines Merged revisions 293194 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r293194 | tilghman | 2010-10-28 14:44:37 -0500 (Thu, 28 Oct 2010) | 5 lines "!00" evaluated as false, which is incorrect. Fixing. Reported (though the reporter did not understand he was reporting a bug) on the asterisk-users list: http://lists.digium.com/pipermail/asterisk-users/2010-October/255505.html ........ ................ r293196 | tilghman | 2010-10-28 14:54:34 -0500 (Thu, 28 Oct 2010) | 12 lines Merged revisions 293194 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r293194 | tilghman | 2010-10-28 14:44:37 -0500 (Thu, 28 Oct 2010) | 5 lines "!00" evaluated as false, which is incorrect. Fixing. Reported (though the reporter did not understand he was reporting a bug) on the asterisk-users list: http://lists.digium.com/pipermail/asterisk-users/2010-October/255505.html ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02Merged revisions 267009 via svnmerge from Paul Belanger
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r267009 | pabelanger | 2010-06-02 13:14:37 -0400 (Wed, 02 Jun 2010) | 7 lines Cleanup error/warning messages in AEL2 parser (closes issue #16684) Reported by: Silmaril Patches: patch_ael2_logmsg.diff uploaded by Silmaril (license 979) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-28Allow "REMAINDER" to function properly in expressions.Jason Parker
(closes issue #16427) Reported by: wdoekes Patches: ast16-reminder-remainder.patch uploaded by wdoekes (license 717) Tested by: wdoekes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03Merged revisions 179807 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 I had some work to do to port these changes to trunk; the check_expr stuff hasn't been updated here for quite some time, it appears. I added some more tests to the check_expr2 suite. I had to play around with the makefile a bit, etc. I added STANDALONE2 #ifdefs to ast_expr2.y so as not to conflict structure with aelparse. ........ r179807 | murf | 2009-03-03 11:11:34 -0700 (Tue, 03 Mar 2009) | 19 lines These changes allow AEL to better check ${} constructs within $[...], that are concatenated with text. I modified and added rules in ast_expr2.fl to better handle the concatenations. I added some default routines to ast_expr2.y so the standalone would compile. It also looks like I haven't run this thru bison since 2.1, so it's good to get this updated. The Makefile has comments added now for check_expr2 and check_expr to explain what they are for, and how to run them. The testexpr2s stuff has been removed, in favor of check_expr2. expr2.testinput has been updated to include the two expressions that inspired these changes (from mcnobody on #asterisk this morning) The regression has been run and all looks well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@179973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15This patch allows null args in ast_expr2 func calls, and fixes commas being ↵Steve Murphy
converted to pipes, which was 1.4 type stuff. If the user says count=ENUMLOOKUP(${EXTEN},ALL,c,,enum.mydomain.tld); then it won't complain about the empty arg (c,,...) and fabled's patch won't let it swap the commas for pipes. Ran it thru my dialplan and no complaints. (closes issue #14169) Reported by: fabled Patches: function-argument-separator-fix.diff uploaded by fabled (license 448) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27Merged revisions 144924-144925 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines improve header inclusion process in a few small ways: - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled - simplify the usage of some of these headers in the AEL-related stuff in the utils directory ........ r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines fix some minor issues with rev 144924 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21(closes issue #12467)Steve Murphy
Reported by: atis Tested by: murf This upgrade adds the ~~ (concatenation) string operator to expr2. While not needed in normal runtime pbx operation, it is needed when raw exprs are being syntax checked. This plays into future syntax- unification plans. By permission of atis, this addition in trunk and the reason of why things are as they are will suffice to close this bug. I also added a short note about the previous addition of "sip show sched" to the CLI in CHANGES, which I discovered I forgot in a previous commit. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16Terry found this problem with running the expr2 parser on OSX. Make the ↵Steve Murphy
#defines come out the same between the parser & lexer. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-25closes issue #11045 - each file needs to define ASTERISK_FILE_VERSION, if ↵Steve Murphy
you are going to set MTX_PROFILE in the compiler flags; the problem was that the fixes were getting made to the generated .c file, and erased the next time someone regenerated that file from the corresponding .y or .flex file. Moral of story: keep your eyes open and make mods to the .y (or flex input file) and re-run bison (or flex) as the Makefile directs for that file, and then check in both. Also, res_config_sqlite was kinda missed, and has the same issue. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17Simplify some preprocessor logic by using #elifTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22Fixes for FreeBSD... testing for every conceivable math function nowTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Check for the presence of trunc and round, and make the ISOC99 detection a ↵Tilghman Lesher
little more sane (closes issue #10776) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-08Restore EXP2 and LOG2 functions, by providing mathematical identify ↵Tilghman Lesher
functions, when the underlying C functions are not available. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-07These changes fix 10145 and 10150, a prob with BSD and exp2/log2 not ↵Steve Murphy
existing, as well as the bootstrap needing a small upgrade for openbsd. Many thanks to mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05resolve a compiler warning so i can build in dev modeRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05In regards to changes for 9508, expr2 system choking on floating point ↵Steve Murphy
numbers, I'm adding this update to round out (no pun intended) and make this FP-capable version of the Expr2 stuff interoperate better with previous integer-only usage, by providing Functions syntax, with 20 builtin functions for floating pt to integer conversions, and some general floating point math routines that might commonly be used also. Along with this, I made it so if a function was not a builtin, it will try and find it in the ast_custom_function list, and if found, execute it and collect the results. Thus, you can call system functions like CDR(), CHANNEL(), etc, from within $\[..\] exprs, without having to wrap them in $\{...\} (curly brace) notation. Did a valgrind on the standalone and made sure there's no mem leaks. Looks good. Updated the docs, too. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02Merged revisions 72933 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r72933 | murf | 2007-07-02 14:16:31 -0600 (Mon, 02 Jul 2007) | 1 line support for floating point numbers added to ast_expr2 $\[...\] exprs. Fixes bug 9508, where the expr code fails with fp numbers. The MATH function returns fp numbers by default, so this fix is considered necessary. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28Jason is having problems with the inclusion of <err.h>; it appears to be ↵Steve Murphy
unnecessary for sucessful builds, so I either removed or commented out the inclusions from all the AEL related code. New outputs from bison/flex are included, etc. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3