lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lightning] Controlling the generated code size


From: Ludovic Courtès
Subject: [Lightning] Controlling the generated code size
Date: Tue, 30 Aug 2005 10:54:25 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

Is there a way, while generating code, to make sure that it won't
produce more code than a certain amount?  This is typically useful to
prevent buffer overflows in code-generating functions that look like:


  void
  generate_code (char *input_buffer, size_t input_buffer_size)
  {
  ...
  }

Of course, one can check the difference between the current IP and
INPUT_BUFFER every three instruction or so and make sure it is always
lower than INPUT_BUFFER_SIZE, but this isn't very reliable.

Thanks,
Ludovic.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]