if (param == NULL || symbol == NULL)
return return_error (tc, TC_NOENT);
+ /* Can't bind the return value for an AOP_INSERT_BEFORE join
+ point! */
+ if (index == -1 && symbol->location == AOP_INSERT_BEFORE)
+ return return_error (tc, TC_BAD_RETURN_BINDING);
+
binding = (struct tc_call_binding *)malloc (sizeof (struct tc_call_binding));
if (binding == NULL)
return return_error (tc, TC_NOMEM);
* \return #TC_SUCCESS or
* - #TC_BAD_CONTEXT, when called after compilation has already
* started;
+ * - #TC_BAD_RETURN_BINDING, if the specified symbol has a location of
+ * #AOP_INSERT_BEFORE;
* - #TC_NOENT, if either the symbol or the binding does not exist;
* - #TC_NOMEM, if memory runs out.
*/
* must only contain letters, numbers and the underscore character,
* with no spaces. Identifiers are case sensitive and should be no
* longer than #TC_MAX_ID_SIZE.)
+ * - #TC_BAD_RETURN_BINDING, if the the declaration binds the return
+ * value but the location is #AOP_INSERT_BEFORE;
* - #TC_NOENT, if one of the parameters in the declaration does not
* exist;
* - #TC_NOMEM, if memory runs out.