Skip to content
beltoforionPublic

About

muparser is a fast math parser library for C/C++ with (optional) OpenMP support.

Topics

Resources

Stars

535 stars

Watchers

33 watching

Forks

Repository files navigation

GitHub issues Version Packaging status

muparser - fast math parser library

title

Change Notes for Revision 2.3.6 (2026-11-10)

Changes:

  • Issue #161: Add HasFun function added to query the existance of a function under a given name.
  • Issue #93: Add cotangent function
  • Issue #158: Add callback type multstrfun_type for functions taking a string constant followed by a variable number of numeric arguments (at least one), i.e. printf("x={0}, y={1}", a, b).

Security Fixes:

  • Issue #167: Add additional checks to eliminate possibility of access violations due to malformed expressions. I dont have test cases and do not know whether this issue was exploitable at all but fixing them made sense.
  • Issue #168: ClearConst() now also clears the internal string variable buffer (m_vStringVarBuf) to keep it in sync with the name-to-index map (m_StrVarDef). Previously stale entries accumulated across repeated ClearConst() calls.
  • Issue #170: Several memory safety, undefined behaviour and thread safety fixes, among them a use-after-free in mupRelease, exceptions crossing the C API boundary and data races on static buffers of the C API.
  • Issue #171: ParserInt now throws ecDOMAIN_ERROR instead of causing a signed integer overflow in Add, Sub, Mul, the unary minus and when rounding values that do not fit into an int.
  • Issue #176: ParserInt::IsBinVal performed the bit shift for binary literals in a signed type, triggering sanitizer reports for literals starting with 1.
  • Issue #182: The C API (muParserDLL) no longer crashes when called with a null parser handle or with null string / pointer arguments. Calls with a null handle are ignored and return default values, null arguments are reported through the regular error mechanism (mupError).

Bug Fixes:

  • Issue #165: String constants used as function arguments were pushed twice into the internal string buffer.
  • Issue #173: Constant folding of "&&" and "||" compares the operands with zero instead of casting them to int. Results for fractional and out-of-range values now match the evaluation without optimizer.
  • Issue #175: A division by a constant zero was dropped from the bytecode when the optimizer was active (i.e. "asin(3/0)" returned 3). It is now evaluated at run time.
  • Issue #180: Parser::Diff now restores the differentiation variable if the evaluation throws. Previously the variable was left at one of the stencil points.

Fixed Compiler Warnings and Errors:

  • Issue #160: Refacturing for better source code compatibility with Fil-C; needlessly "clever" code replaced with a more maintainable version.

Change Notes for Revision 2.3.5

New Features:

  • added a rnd() function

Fixed Compiler Warnings:

  • Fix problem with IntelLLVM fast math

Build System:

  • fix for #127 minimum required cmake version set to 3.15
  • fix for #132 example1 fails to builds on Windows with mingw gcc
  • fix for #147 Build failed with MSVC/C++20

Change Notes for Revision 2.3.4

Maintainance Release with updates of the cmake build system.

Build System:

  • cmake is using OpenMP target and setting _UNICODE preprocessor definition

Fixed Compiler Warnings:

  • fix for #117 (sprintf deprecated)

Change Notes for Revision 2.3.3

To read the full documentation please go to: http://beltoforion.de/en/muparser.

See Install.txt for installation

Security Fixes:

The following new issues, discovered by oss-fuzz are fixed:

Bugfixes:

  • Fixed a couple of issues for building the C-Interface (muParserDLL.cpp/.h) with wide character support.
  • fix for #93
  • fix for #94
  • fix for #110; new expression size limit is 20000

Fixed Compiler Warnings:

  • Visual Studio: Disabled compiler warning 26812 (Prefer 'enum class' over 'enum') Use of plain old enums has not been deprecated and only MSVC is complaining.
  • Visual Studio: Disabled compiler warning 4251 (... needs to have dll-interface to be used by clients of class ...) For technical reason the DLL contains the class API and the DLL API. Just do not use the class API if you intent to share the dll accross windows versions. (The same is true for Linux but distributions do compile each application against their own library version anyway)

Changes:

  • Adding manual definitions to avoid potential issues with MSVC
  • Adding missing overrides
  • Added a new option "-DENABLE_WIDE_CHAR" to CMake for building muparser with wide character support
  • export muparser targets, such that client projects can import it using find_package() (#81 (comment))

About

muparser is a fast math parser library for C/C++ with (optional) OpenMP support.

Topics

Resources

Stars

535 stars

Watchers

33 watching

Forks

Releases

Packages

Used by

Contributors

Languages