Don't evaluate built-in system functions if they are overridden.

We don't support evaluating user-defined system functions at compile
time. If possible, defer evaluation until run time. If used in a
constant expression, output a "sorry" message.
This commit is contained in:
Martin Whitaker
2019-10-19 16:12:17 +01:00
parent bf655003e8
commit 1069a0ef02
9 changed files with 72 additions and 32 deletions
+5 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2018 Stephen Williams ([email protected])
* Copyright (c) 1999-2019 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -2400,6 +2400,10 @@ NetESFunc::ID NetESFunc::built_in_id_() const
NetExpr* NetESFunc::eval_tree()
{
/* We don't support evaluating overridden functions. */
if (is_overridden_)
return 0;
/* Get the ID for this system function if it can be used as a
* constant function. */
ID id = built_in_id_();