Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e86091f8 authored by hhakim's avatar hhakim
Browse files

Secure the constructor matfaust.Faust(handle,isReal) to avoid inconsistent...

Secure the constructor matfaust.Faust(handle,isReal) to avoid inconsistent situations where the handle points to a real or complex Faust::TransformHelper while isReal is resp. false or true.

FYI this constructor is for wrapper internal use only.
parent 65e2e0a6
Branches
Tags
No related merge requests found
...@@ -194,6 +194,12 @@ classdef Faust ...@@ -194,6 +194,12 @@ classdef Faust
% create a Faust directly with the c++ object handler/pointer without any pre-existing Faust % create a Faust directly with the c++ object handler/pointer without any pre-existing Faust
F.matrix = FaustCore(varargin{1}, varargin{2}); F.matrix = FaustCore(varargin{1}, varargin{2});
F.isReal = varargin{2}; F.isReal = varargin{2};
% hack to raise an error in case of non-consistent handle and isReal arg.
try
n = get_num_factors(F);
catch
error('The Faust handle passed as first argument is not valid or not consistent with the value of isReal (2nd argument).')
end
else else
error(err_msg) error(err_msg)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment