- Subject: [slang-users] tcc module
- From: ag <aga.chatzimanikas@xxxxxxxxx>
- Date: Sun, 22 Apr 2018 20:40:59 +0300
On Thu, Mar 29, at 08:24 John E. Davis wrote:
> On Thu, Mar 29, at 09:08 Ag. D.E Chatzimanikas wrote:
>>> First, the tcc api gives the freedom to call a callback function when
>>> encounters an error, with the following signature:
>>>
>>> void __tcc_error_handler (void *opaque, const char *msg)
>>>
>>> For now, the default handler in the tcc-module looks first for a slang
>>> defined function "tcc_error_handler".
>>> If it is defined, it pushes the message string and calls that function.
>
> Does that handler trap Segmentation Violations, etc? Is there anyway
> to run the tcc code in a protected environment so that it will not
> affect the interpreter in undesirable ways?
Every little thing can affect the interpreter. Someone can use the existing
mechanisms. The only thing that we can do is to avoid namespace collisions and
the usual stuff, as there isn't much to interfere, as additionally there are
not threads and just one interpreter state to protect.
> how to do this would be to run the tcc-compiled code in a separate
> process and communicate back via shared memory or file descriptors.
Yes, and also if you think that processes are cheap (at least in Linux) and
provide the same performance and there are better secured. The only thing,
as you've said is the communication between processes. But that is another
thing really.
> Thanks,
> --John
Best,
Αγαθοκλής
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.
[2018 date index]
[2018 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]